View Full Version : About JsonStore, how it get data from JSon data, the data with Composite primary key

15 Jan 2015, 2:20 PM
Hi There,

My code and sample data below:
My JSonStore can't get data from Java.
Composite primary key is PO and STYLE_NO
var store = new Ext.data.JsonStore({

var PaymentObj = [
{ name:'id', type:'string'},
{ name:'id.po', type:'string'},
{ name:'id.style_no', type:'string'},
{ name:'totalfee', type:'string'},
{ name:'paidfee', type:'string'},
{ name:'paydate', type:'string'}

var store = new Ext.data.JsonStore({
url: 'payment_findPagePayment.do',
root: 'root',
totalProperty: 'total',
autoLoad: {params:{start:0, limit:15}},
fields: PaymentObj

var grid = new Ext.grid.GridPanel({
store: store,
cm: new Ext.grid.ColumnModel({
defaults: { menuDisabled : true},
columns:[new Ext.grid.RowNumberer(),
{header: 'Client PO', width: 150,align:'center', dataIndex: 'id.po'},
{header: 'Style No', width: 150,align:'center', dataIndex: 'id.style_no'},
{header: 'Total', width: 150, align:'center',dataIndex: 'totalFee'},
{header: 'Paid', width: 150, align:'center',dataIndex: 'paidFee'},
{header: 'Date', align:'center',dataIndex: 'payDate'}]
//Sample JSon data from java action
Thanks a lot

19 Jan 2015, 11:17 AM
You'll need to use a convert function to concatenate two other mapped fields.



19 Jan 2015, 5:38 PM
Thanks a lot,,

19 Jan 2015, 10:23 PM
my Extjs version is 3.3.0, there are no Ext.data.Model. So How can I handle Composite primary key? And could you give sample code that how load into the Ext.data.JsonStore? Thanks a lot