Results 1 to 3 of 3

Thread: Only allow combo box to be chosen once in a group of combo boxes.

  1. #1
    Sencha User
    Join Date
    May 2013
    Posts
    48
    Vote Rating
    0
      0  

    Default Only allow combo box to be chosen once in a group of combo boxes.

    Hey Sencha,

    Was hoping for some help, I have a trigger system developed, however in my Match All conditions it makes sense that each dropdown box value could only be selected once.

    Aka:
    Match All
    Time is 8:00
    Time is 9:00
    Would always fail as it would never meet both those conditions... I want time to disappear from the other combo boxes while its selected and disappear when its changed.

    Was thinking of removing it from the store and then refreshing the combo boxes, only problem is I force selection and it clears it from the combo box.

    Ok so Here was my solution... I solved it
    Code:
    ####.####.Parameter = new Ext.extend(Ext.form.ComboBox, {
            type: 'all',
            oldrec: null,
            store: null,
            constructor: function (config) {
                var me = this;
                if (config.type === 'all') {
                    me.store = AllConditionStore;
                } else {
                    me.store = ####.####('RuleParameterType');
                }
                config = Ext.apply({
                    store: me.store,
                    valueField: 'id',
                    hideActive: true,
                    triggerAction: 'all',
                    lazyRender: true,
                    allowBlank: false,
                    mode: 'local',
                    displayField: 'text',
                    listeners: {
                        select: function (me, recs, index) {
                            if (me.oldrec !== null)
                                me.store.add(me.oldrec);
                            me.oldrec = recs;
                            me.store.remove(recs);
                        }
                    }
                }, config);
                ####.#####.Parameter.superclass.constructor.call(this, config);
            }
    });
    
    
    Ext.reg('####.####.parameterCombo', ####.####.Parameter);

  2. #2
    Sencha User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,026
    Vote Rating
    1367
      0  

    Default

    Code:
    new Ext.extend
    That doesn't look good.
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Frontend Engineer
    ________________
    Need any sort of Ext JS help? Modus Create is here to help!

    Check out my GitHub:
    https://github.com/mitchellsimoens

  3. #3
    Sencha User
    Join Date
    May 2013
    Posts
    48
    Vote Rating
    0
      0  

    Default

    Working great, what do you recommend?

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •