X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/0494b8d9b9bb03ab6c22b34dae81261e3cd7e3e6..7a654f8d43fdb43d78b63d90528bed6e86b608cc:/examples/ux/grid/menu/ListMenu.js diff --git a/examples/ux/grid/menu/ListMenu.js b/examples/ux/grid/menu/ListMenu.js new file mode 100644 index 00000000..4fac0018 --- /dev/null +++ b/examples/ux/grid/menu/ListMenu.js @@ -0,0 +1,176 @@ +/** + * @class Ext.ux.grid.menu.ListMenu + * @extends Ext.menu.Menu + * This is a supporting class for {@link Ext.ux.grid.filter.ListFilter}. + * Although not listed as configuration options for this class, this class + * also accepts all configuration options from {@link Ext.ux.grid.filter.ListFilter}. + */ +Ext.define('Ext.ux.grid.menu.ListMenu', { + extend: 'Ext.menu.Menu', + + /** + * @cfg {String} labelField + * Defaults to 'text'. + */ + labelField : 'text', + /** + * @cfg {String} paramPrefix + * Defaults to 'Loading...'. + */ + loadingText : 'Loading...', + /** + * @cfg {Boolean} loadOnShow + * Defaults to true. + */ + loadOnShow : true, + /** + * @cfg {Boolean} single + * Specify true to group all items in this list into a single-select + * radio button group. Defaults to false. + */ + single : false, + + constructor : function (cfg) { + this.selected = []; + this.addEvents( + /** + * @event checkchange + * Fires when there is a change in checked items from this list + * @param {Object} item Ext.menu.CheckItem + * @param {Object} checked The checked value that was set + */ + 'checkchange' + ); + + this.callParent([cfg = cfg || {}]); + + if(!cfg.store && cfg.options){ + var options = []; + for(var i=0, len=cfg.options.length; i