PDA

View Full Version : multiselect and JsonStore



wpoPR
1 Mar 2010, 6:18 AM
Hi, I use multiselect component, and it works fine, but when I use along with JsonStore I have a problem, my JsonStore is load after my form, and does not work.

// my Store


var ds = new Ext.data.JsonStore({
url: '<%= Url.Action("getTest") %>',
autoLoad: true,
root: "Items",
fields: [
{ name: 'Id', type: 'int' },
{ name: 'name' }
]
});

// my form



var Frm = new Ext.form.FormPanel
({
labelAlign: 'top',
frame:true,
bodyStyle:'padding:5px 5px 0',
width: 500,
url: '<%= Url.Action("Save") %>',
items:
[{ // Linha I
layout:'column',
items:
[{
columnWidth:.5,
xtype: 'container',
layout: 'form',
items:[{
id: 'test',
xtype: 'multiselect',
name: 'Test',
fieldLabel: 'Test',
store: ds,
displayField: 'name',
valueField: 'Id',
hiddenName: 'test.Id',
forceSelection: true,
mode: 'local',
triggerAction: 'all',
allowBlank: false
}]
}
}]
}
});

Frm.render("div-form");


when loading, the store is filled, but does not load in my multiselect, if I change only xtype: 'combo' works perfectly.

thanks for help...

TheMonolith
1 Mar 2010, 7:49 AM
You have better chances of getting a response when you properly format your code.