Threaded View

  1. #1
    Ext JS Premium Member stever's Avatar
    Join Date
    Mar 2007
    Posts
    1,407
    Vote Rating
    6
    stever will become famous soon enough stever will become famous soon enough

      0  

    Default Combo's with inline data

    Combo's with inline data


    Use a combo box with data inline like this:

    Code:
    {
    	xtype:'combo',
    	store:['Reader','Participant','Moderator','SuperUser']
    }
    or

    Code:
    {
    	xtype:'combo',
    	store:[['r','Reader'],['p','Participant'],['m','Moderator'],['s','SuperUser']]
    }


    Code:
    /**
     * @author Steven Roussey
     */
    
    Ext.ux.ComboBox = function(config){
    	if (Ext.isArray(config.store))
    	{
    		if (Ext.isArray(config.store[0]))
    		{
    			config.store = new Ext.data.SimpleStore({
    			    fields: ['value','text'],
    			    data : config.store
    			});
    	        config.valueField = 'value';
                config.displayField = 'text';
    		}
    		else
    		{
    			var store=[];
    			for (var i=0,len=config.store.length;i<len;i++)
    				store[i]=[config.store[i]];
    			config.store = new Ext.data.SimpleStore({
    			    fields: ['text'],
    			    data : store
    			});
    	        config.valueField = 'text';
                config.displayField = 'text';
    		}
    		config.mode = 'local';
    	}
        Ext.ux.ComboBox.superclass.constructor.call(this, config);
    }
    Ext.extend(Ext.ux.ComboBox,Ext.form.ComboBox,{
    	
    });
    Ext.reg('combo',Ext.ux.ComboBox);
    Last edited by stever; 14 Feb 2008 at 5:08 PM. Reason: Updated to v1.0.1 (uses Ext.isArray() to detect arrays)

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar