1. #1
    Ext User
    Join Date
    Apr 2009
    Posts
    2
    Vote Rating
    0
    dnvhariprasad is on a distinguished road

      0  

    Default Load data into multiselect

    Load data into multiselect


    Hello All,

    I am using multiselect in my project.
    Can any one let me know how can we load data into toMultiselect list on load of the control?

    I have 2 datastores and second data store is empty.

    This is my code:


    var ds1 = new Ext.data.ArrayStore({
    data : [],
    fields : ['value', 'text'],
    sortInfo : {
    field : 'value',
    direction : 'ASC'
    }
    });

    var ds = new Ext.data.ArrayStore({
    data : [['123', 'One Hundred Twenty Three'], ['1', 'One'],
    ['2', 'Two'], ['3', 'Three'], ['4', 'Four'],
    ['5', 'Five'], ['6', 'Six'], ['7', 'Seven'],
    ['8', 'Eight'], ['9', 'Nine']],
    fields : ['value', 'text'],
    sortInfo : {
    field : 'value',
    direction : 'ASC'
    }
    });


    var isForm = new Ext.form.FormPanel({
    title : groupLabel,
    width : 700,
    bodyStyle : 'padding:10px;',

    items : [{
    xtype : 'itemselector',
    name : 'itemselector',
    imagePath : '/webtop/custom/theme/documentum/images/ux',
    multiselects : [{
    width : 250,
    height : 200,
    store : ds,
    displayField : 'text',
    valueField : 'value'
    }, {
    width : 250,
    height : 200,
    store : ds1,
    displayField : 'text',
    valueField : 'value'
    }]
    }],

    buttons : [{
    text : 'Save',
    handler : function() {
    if (isForm.getForm().isValid()) {
    var itemselector = isForm.getForm().findField("itemselector");
    Ext.get(groupName).update(itemselector.getAllValues());
    var groupId = "hidden_" + groupName;
    document.getElementById(groupId).value = itemselector.getValue();
    win.hide();

    }
    }
    }]
    });



    var win = new Ext.Window({
    title : 'Signatories',
    closable : true,
    plain : true,
    width: 700,
    height: 350,
    items : [isForm]


    });

    win.show(this);

  2. #2
    Sencha User steffenk's Avatar
    Join Date
    Jul 2007
    Location
    Haan, Germany
    Posts
    2,657
    Vote Rating
    6
    steffenk has a spectacular aura about steffenk has a spectacular aura about steffenk has a spectacular aura about

      0  

    Default


    what do you think is ds1 store for?

    btw - please use code tags for source code
    vg Steffen
    --------------------------------------
    Release Manager of TYPO3 4.5

Similar Threads

  1. Remote load combo box & multiselect
    By rlr2maverick in forum Ext 2.x: User Extensions and Plugins
    Replies: 10
    Last Post: 3 May 2010, 7:51 AM
  2. Prevent old to load in ExtJS MultiSelect
    By extJSStartup in forum Ext 3.x: Help & Discussion
    Replies: 0
    Last Post: 25 Nov 2009, 9:41 AM
  3. MultiSelect/ItemSelector 3.0 Load Data
    By Romantik in forum Ext 3.x: Help & Discussion
    Replies: 3
    Last Post: 30 Sep 2009, 2:02 PM
  4. MultiSelect/ItemSelector 3.0 Load Data problem [SOLVED]
    By squarefan in forum Ext 2.x: Help & Discussion
    Replies: 6
    Last Post: 15 Mar 2009, 9:48 AM
  5. [SOLVED] Data in multiselect?
    By Capi666 in forum Ext 2.x: Help & Discussion
    Replies: 3
    Last Post: 25 Mar 2008, 12:57 AM

Thread Participants: 1

Tags for this Thread