[CLOSED] Add values to Multiselect manually

  1. #1

    [CLOSED] Add values to Multiselect manually

    Hi,

    How could I do something similar like this in v1.x:

    MultiSelect1.store.add(new Ext.data.Record({text: 'New item', value: 4 }))
    I tried with

    MultiSelect1.store.add(new Ext.data.Model({ fields: [{ text:  'New item', value: 4}] }));
    Because model constructor throws me an error in

    Constructor Function of Ext.data.Model
    if (!convertedData) {
                
                fields = me.fields.items; // **** Here me.fields is undefined**** 
                length = fields.length;
                i = 0;
                persistenceProperty = me[me.persistenceProperty];
    But I have the same error
    Last edited by Daniil; Jul 11, 2012 at 8:10 AM. Reason: [CLOSED]
  2. #2
    Hi,

    I think this should work.

    Example
    MultiSelect1.store.add({ text: 'New item', value: 4});
    See also
    http://docs.sencha.com/ext-js/4-1/#!...ore-method-add
  3. #3
    It works thanks.

    I tried this method too but like this because in documentation indicate that you must pass an array

    MultiSelect1.store.add([{ text: 'New item', value: 4}]);
  4. #4
    Well, according to the docs the argument might be not an array.

Similar Threads

  1. Replies: 4
    Last Post: May 09, 2012, 9:24 PM
  2. Selecting multiple values in Multiselect
    By masudcseku in forum 1.x Help
    Replies: 1
    Last Post: Nov 23, 2011, 7:26 AM
  3. Replies: 0
    Last Post: Apr 29, 2011, 8:37 PM
  4. Replies: 8
    Last Post: Jan 27, 2011, 9:33 PM
  5. Multiselect - Get Values and Update Store
    By Tbaseflug in forum 1.x Help
    Replies: 6
    Last Post: Jul 13, 2009, 3:24 PM

Posting Permissions