PDA

View Full Version : ItemSelector issue



yga
19 May 2011, 11:57 AM
Selected item in left pane wont show correctly in rigth pane

CODE:
var dataRecordCentroP = new Ext.data.Record.create([
{name:'Id', type: 'int'},
{name:'Desc', type: 'string'}
]);

var dataReaderCentroP = new Ext.data.JsonReader(
{totalProperty: 'count',
root:'data'},
dataRecordCentroP
);

var dataProxyCentroP = new Ext.data.HttpProxy({
url:url,
method: 'POST'
});

var ds = new Ext.data.Store({
id: 'centroDS',
proxy: dataProxyCentroP,
reader: dataReaderCentroP,
autoLoad:true
});

var isForm = new Ext.form.FormPanel({
title: 'ItemSelector Test',
width:700,
bodyStyle: 'padding:10px;',
renderTo: 'itemselector',
items:[{
xtype: 'itemselector',
name: 'itemselector',
fieldLabel: 'ItemSelector',
imagePath: '../ux/images/',
multiselects: [{
width: 250,
height: 200,
store: ds,
displayField: 'Desc',
valueField: 'Id'
},{
width: 250,
height: 200,
store: [],
tbar:[{
text: 'clear',
handler:function(){
isForm.getForm().findField('itemselector').reset();
}
}]
}]
}],

buttons: [{
text: 'Save',
handler: function(){
if(isForm.getForm().isValid()){
Ext.Msg.alert('Submitted Values', 'The following will be sent to the server: <br />'+
isForm.getForm().getValues(true));
}
}
}]
});

the data is displayed fine in left pane, but when you select and passes the selection to the rigth there is no displayed text.
what I'm doing wrong?:s