The strings you are looking to customize are part of the dojox/grid/enhanced/nls/Filter
localization bundle. A reference to this bundle gets stored on the Filter
plugin itself in its constructor (e.g. here in 1.9.1).
The most reusable and least volatile way to customize these messages would likely be to create an extension of the Filter plugin and alter the nls
object accordingly. For example: (the following assumes you have required dojo/_base/declare
, dojo/_base/lang
, dojox/grid/EnhancedGrid
, and dojox/grid/enhanced/plugins/Filter
to appropriate variables)
var CustomFilter = declare(Filter, {
name: 'customFilter',
constructor: function () {
// Avoid modifying the original nls bundle
this.nls = lang.clone(this.nls);
// Alter the "no filter applied" message
this.nls.filterBarMsgNoFilterTemplate = 'Custom message here';
// Alter other messages here
}
});
EnhancedGrid.registerPlugin(CustomFilter);
Then, when you are creating your EnhancedGrid instance, instead of specifying a filter
key in your plugins
hash, you will specify customFilter
instead. Its properties will remain the same, since you are still extending the original plugin.
If you need to figure out the keys in the nls
object for the messages you wish to customize, have a look at the source for the bundle that defines them.
Note, of course, that normally different localization bundles are loaded depending on the browser's locale. The above example assumes you're only concerned with supporting one language with your customizations; if you wanted to support multiple, you'd likely want to set up your own set of nls resources to mix in on top of the first. If you need help with that I can expand this answer, but this ought to at least get you started.