PDA

View Full Version : Loading Data into Itemselector using json php



murkrishna
5 Feb 2010, 5:34 AM
Hi,

I was trying to create form with the itemselector which needs to load the data from the database using php (JSON).

The below pasted code is work but has a issue. The data is getting loaded in itemselector in the from and to parts. but the data is not displayed in the to part when I click on the arrow keys then the complete list is displayed. Can anyone give me solution for the same.



this.firststore = new Ext.data.Store({
baseParams: {
from: 'firststore'
}
, proxy: new Ext.data.HttpProxy({
url: 'file1.php'
})
, reader: new Ext.data.JsonReader({
id: 'id'
, root: 'firststore'
//, totalProperty: 'total'
}
, [
{name: 'id', mapping: 'id1'},
{name: 'name1', mapping: 'name1'}
])
, sortInfo: {
field: 'name1',
direction: 'ASC'
}
});


this.secondstore = new Ext.data.Store({
baseParams: {
from: 'secondstore'
}
, proxy: new Ext.data.HttpProxy({
url: 'file2.php'
})
, reader: new Ext.data.JsonReader({
id: 'id'
, root: 'secondstore'
//, totalProperty: 'total'
}
, [
{name: 'id', mapping: 'id'},
{name: 'name1', mapping: 'name1'}
])
, sortInfo: {
field: 'name2'
, direction: 'ASC'
}
});

this.firststore.load();
this.secondstore.load();

var formPanel = new Ext.FormPanel ({
bodyStyle: 'padding:5px 0 0 5px'
, border: false
, buttons: [
{
handler: this.onAdd
, scope: this
, text: 'Add'
, type: 'submit'
}
, {
handler: this.onCancel
, scope: this
, text: 'Cancel'
}
]
, buttonAlign: 'right'
, items: [{
allowBlank:false
, anchor: '98%'
, fieldLabel: 'Name'
, name: 'name'
, xtype:'textfield'
}, {
xtype: 'itemselector'
, name: 'itemselector'
, fieldLabel: 'ItemSelector'
, imagePath: 'client/ux/images/'
, multiselects: [{
width: 250
, height: 200
, store: this.firststore
, displayField: 'name1'
, valueField: 'id1'
},{
width: 250
, height: 200
, store: this.secondstore
, displayField: 'name1'
, valueField: 'id'
}]
}]
, labelWidth: 75
});



Thanks and regards
Murali krishna .L

murkrishna
17 Feb 2010, 11:23 PM
I am surprised to see that no one have faced the problem / no one have used this type of layout.

Murali krishna .L
:((:(

mahner
29 Jun 2010, 3:10 PM
I am surprised to see that no one have faced the problem / no one have used this type of layout.

Murali krishna .L
:((:(

I just stumbled upon the same problem. Did you find a solution?

regards,
.

johnstontrav
10 Oct 2010, 4:51 PM
i got the same problem. I have not found a solution yet. You guys have any luck?