PDA

View Full Version : Grid is displaying only one row



After2050
6 Jul 2011, 5:27 AM
Hi,

Here is my javascript code,



var store = new Ext.data.JsonStore({
autoLoad: true,
url: '/home/jobs',
idProperty: 'Name',
fields: ['Name', 'Description', 'Type', 'Group', 'Data',
{ name: 'IsDurable', type: 'boolean' },
{ name: 'IsStateful', type: 'boolean' },
{ name: 'IsVolatile', type: 'boolean' },
{ name: 'RequestsRecovery', type: 'boolean' },
{ name: 'RunningSince', type: 'date' },
{ name: 'NoOfListeners', type: 'int'}],
root: 'data'
});

var panelwithgrid = new Ext.Panel({
title: 'Jobs',
width: 900,
height: 'auto',
renderTo: 'content',
tbar: [{
xtype: 'button',
iconCls: 'icon-add',
text: 'Add',
handler: AV.Manage.Jobs.addJob
}],
items: [{

xtype: 'grid',

loadMask: true,

defaults: {
sortable: true
},

store: store,

columns: [
{ id: 'Name', header: 'Name', sortable: true, dataIndex: 'Name' },
{ header: 'Description', dataIndex: 'Description' },
{ header: 'Type', dataIndex: 'Type', width: 150 },
{ header: 'Group', dataIndex: 'Group' },
{ header: 'Data', dataIndex: 'Data' },
{ header: 'Durable', dataIndex: 'IsDurable', width: 50 },
{ header: 'Stateful', dataIndex: 'IsStateful', width: 50 },
{ header: 'Volatile', dataIndex: 'IsVolatile', width: 50 },
{ header: 'Req. Recovery', dataIndex: 'RequestsRecovery', width: 80 },
{ header: 'Running Since', dataIndex: 'RunningSince', width: 100, xtype: 'datecolumn', format: 'M d, Y' },
{ header: '#Listeners', dataIndex: 'NoOfListeners', width: 60 },
{ header: '#Triggers', dataIndex: 'NoOfTriggers', width: 60}, actions],


bbar: new Ext.PagingToolbar({
pageSize: 10,
store: store,
autoLoad: false,
displayInfo: true,
emptyMsg: 'No jobs to display.'
})
}]
})


This is the json data returned from server,

{"total":2,"data":[{"ExtensionData":{},"Data":"\u003cparams\u003e\u003cassn_id\u003e55\u003c/assn_id\u003e\u003clogin_id\u003e179\u003c/login_id\u003e\u003c/params\u003e","Description":null,"Group":"DEFAULT","IsDurable":false,"IsStateful":false,"IsVolatile":false,"Name":"caliberJob","NoOfListeners":0,"NoOfTriggers":0,"RequestsRecovery":false,"RunningSince":null,"Type":"AV.Scheduler.Jobs.CaliberJob"},{"ExtensionData":{},"Data":"","Description":null,"Group":"DEFAULT","IsDurable":false,"IsStateful":false,"IsVolatile":false,"Name":"testJob","NoOfListeners":0,"NoOfTriggers":0,"RequestsRecovery":false,"RunningSince":null,"Type":"AV.Scheduler.Jobs.TestJob"}],"success":true}

The grid is displaying only the first row not the two rows. Any help appreciated.

mitchellsimoens
6 Jul 2011, 6:26 AM
Is it there and just the GridPanel and/or Panel are just not tall enough to show?

Also, not knowing the context of what is used, do you really need the GridPanel to be nested in the Panel?