1. #1
    Sencha User
    Join Date
    Feb 2012
    Location
    Copenhagen
    Posts
    32
    Vote Rating
    0
    Igor.Szyporyn is on a distinguished road

      0  

    Default Ext.ux.form.field.QuickCombo

    Ext.ux.form.field.QuickCombo


    Now this may already have been made, or the config settings in 4.2.2 may allow it already - if so, then let me know please.

    Because when I supplied a field definition by a "fields" config option, and data in a "data" config options - it did nothing for me.

    So I give to you a (possibly olde) QuickCombo.

    Takes normal config options, and unobtrusively lets you define a data and fields config option to bypass that pesky store implementation when all you want is a local quick and snappy combo.

    Here is code

    Code:
    Ext.define('Ext.ux.form.field.QuickCombo', {
        extend: 'Ext.form.field.ComboBox',
        alias: 'widget.quickcombo',
    
    
        /**
         * @cfg {Array} data
         * The data to put in the quickcombo
         */
    
    
        /**
         * @cfg {Array} fields
         * The fields the store uses for data
         */
    
    
        initComponent: function () {
    
    
            var i_cmp = this,
                i_store = i_cmp.createStore();
    
    
            Ext.apply(i_cmp, {
                store: i_store
            });
    
    
            i_cmp.callParent();
    
    
            return i_cmp;
        },
    
    
        createStore: function () {
    
    
            var i_cmp = this,
                a_field = i_cmp.fields || [],
                a_data = i_cmp.data || [],
                i_store;
    
    
            i_store = Ext.create('Ext.data.Store', {
                fields: a_field,
                data: a_data
            });
    
    
            return i_store;
        }
    });

  2. #2
    Sencha - Support Team
    Join Date
    Feb 2013
    Location
    California
    Posts
    5,446
    Vote Rating
    112
    Gary Schlosberg is just really nice Gary Schlosberg is just really nice Gary Schlosberg is just really nice Gary Schlosberg is just really nice Gary Schlosberg is just really nice

      0  

    Default


    Sounds handy! Thanks for sharing your work with the community.
    Are you a Sencha products veteran who has wondered what it might be like to work at Sencha? If so, please reach out to our human resources manager: fabienne.bell@sencha.com

Thread Participants: 1