/* This file is part of Ext JS 4 Copyright (c) 2011 Sencha Inc Contact: http://www.sencha.com/contact GNU General Public License Usage This file may be used under the terms of the GNU General Public License version 3.0 as published by the Free Software Foundation and appearing in the file LICENSE included in the packaging of this file. Please review the following information to ensure the GNU General Public License version 3.0 requirements will be met: http://www.gnu.org/copyleft/gpl.html. If you are unsure which license is appropriate for your use, please contact the sales department at http://www.sencha.com/contact. */ /** * @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