toxkillfraex
10 Apr 2012, 12:28 AM
It's probably a retarded mistake, but I'm at the point of tearing my hair out. So I'll ask anyway.
I have a grid defined like this
var grid = new Ext.grid.GridPanel
({
id: 'auditGrid',
store : null,
columns: [
{ header: 'Timestamp', dataIndex: 'timestamp', width: 70 },
{ header: 'Reason', dataIndex: 'reason' , flex:1},
{ header: 'Action', dataIndex: 'action' ,width:95},
{ header: 'User id', dataIndex: 'userid', width:95},
{ header: 'First name', dataIndex: 'firstname', width:130},
{ header: 'Family name', dataIndex: 'familyname', width:130}
],
viewConfig:
{
forceFit: true
},
autoScroll: true,
columnLines: true
});
I have a model defined like this:
Ext.define('APP.model.AuditTrail',
{
extend: 'Ext.data.Model',
fields:
[
'timestamp',
'reason',
'action',
'userid',
'firstname',
'familyname'
]
});
and in a controller I try to create the store with the model. If I load the store there it returns all the records fine, but just setting the store of the grid gives me 5 empty lines...
var auditStore = Ext.create('Ext.data.Store',
{
model : 'APP.model.AuditTrail',
proxy:
{
type : 'rest',
url : APP.model.Cookie.config.serverUrl + '/app/documents/'
+ document.data.id + '/audits',
reader :
{
type : 'json',
root : 'content.audittrail'
},
actionMethods :
{
read : 'GET'
},
extraParams :
{
sessionId : session.sessionId
},
autoLoad : true
}
});
me.getAuditGrid().store = auditStore;
/*auditStore.load(function(record, operation, success)
{
console.log(record);
});*/
I try the url that's used and it returns json that kinda looks like this:
{"content":{"audittrail":[{"timestamp":1334041821000,"reason":null,"action":"dm_getfile","userid":1,"firstname":"Gordon","familyname":"Freeman"},{"timestamp":1334041820000,"reason":null,"action":"dm_fetch","userid":1,"firstname":"Gordon","familyname":"Freeman"},{"timestamp":1334009763000,"reason":null,"action":"dm_getfile","userid":1,"firstname":"Gordon","familyname":"Freeman"},{"timestamp":1323259972000,"reason":null,"action":"dm_link","userid":1,"firstname":"Gordon","familyname":"Freeman"}]},"status":{"message":"OK","status":200}
it returns over a thousand records but then I'd more expect a lengthy load time instead of just... blank recods in the grid =/
what am i doing wrong?
I tried reconfigure on the store but then it simply gives me an error in the trend of not finding length of undefined
I have a grid defined like this
var grid = new Ext.grid.GridPanel
({
id: 'auditGrid',
store : null,
columns: [
{ header: 'Timestamp', dataIndex: 'timestamp', width: 70 },
{ header: 'Reason', dataIndex: 'reason' , flex:1},
{ header: 'Action', dataIndex: 'action' ,width:95},
{ header: 'User id', dataIndex: 'userid', width:95},
{ header: 'First name', dataIndex: 'firstname', width:130},
{ header: 'Family name', dataIndex: 'familyname', width:130}
],
viewConfig:
{
forceFit: true
},
autoScroll: true,
columnLines: true
});
I have a model defined like this:
Ext.define('APP.model.AuditTrail',
{
extend: 'Ext.data.Model',
fields:
[
'timestamp',
'reason',
'action',
'userid',
'firstname',
'familyname'
]
});
and in a controller I try to create the store with the model. If I load the store there it returns all the records fine, but just setting the store of the grid gives me 5 empty lines...
var auditStore = Ext.create('Ext.data.Store',
{
model : 'APP.model.AuditTrail',
proxy:
{
type : 'rest',
url : APP.model.Cookie.config.serverUrl + '/app/documents/'
+ document.data.id + '/audits',
reader :
{
type : 'json',
root : 'content.audittrail'
},
actionMethods :
{
read : 'GET'
},
extraParams :
{
sessionId : session.sessionId
},
autoLoad : true
}
});
me.getAuditGrid().store = auditStore;
/*auditStore.load(function(record, operation, success)
{
console.log(record);
});*/
I try the url that's used and it returns json that kinda looks like this:
{"content":{"audittrail":[{"timestamp":1334041821000,"reason":null,"action":"dm_getfile","userid":1,"firstname":"Gordon","familyname":"Freeman"},{"timestamp":1334041820000,"reason":null,"action":"dm_fetch","userid":1,"firstname":"Gordon","familyname":"Freeman"},{"timestamp":1334009763000,"reason":null,"action":"dm_getfile","userid":1,"firstname":"Gordon","familyname":"Freeman"},{"timestamp":1323259972000,"reason":null,"action":"dm_link","userid":1,"firstname":"Gordon","familyname":"Freeman"}]},"status":{"message":"OK","status":200}
it returns over a thousand records but then I'd more expect a lengthy load time instead of just... blank recods in the grid =/
what am i doing wrong?
I tried reconfigure on the store but then it simply gives me an error in the trend of not finding length of undefined