I am having problems getting data to show up in the grid. can someone help me
Here is my code/ form the data is coming in
Code:
Ext.define('User', {
extend: 'Ext.data.Model',
fields: [
{
name : 'task_code',
type : 'string'
},{
name : 'lastname',
type : 'string'
}]
});
var userStore = Ext.create('Ext.data.Store', {
pageSize : $page_size,
model : 'User',
autoLoad : true,
proxy: {
type: 'ajax',
url: '$self?get_json=yes'
},
reader: {
type : 'json',
root : 'rows',
totalProperty: 'totalCount'
}
});
Ext.create('Ext.grid.Panel', {
renderTo : divGrid,
store : userStore,
width : viewport_width,
height : viewport_height,
title : 'Application Users',
columns : [
{
text : 'Task Name',
width : 250,
sortable : false,
hideable : false,
dataIndex : 'lastname'
},
{
text : 'Task code',
width : 150,
dataIndex : 'task_code',
hidden : false
},
{
text : 'Task code',
flex : 1,
dataIndex : 'task_code'
}
],
dockedItems: [{
xtype: 'pagingtoolbar',
store: userStore,
dock: 'bottom'
}]
});
Here is the form of my data
Code:
{
"success": true,
"totalCount": 714,
"rows": [{
"task_code": "A15340",
"lastname" : "ENG020b PM FTD1 Test Travel"
},{
"task_code": "A15290",
"lastname" : "ENG021a PM FTD2 Test Travel"
},{
"task_code": "A15380",
"lastname" : "ENG022c PM FTD3 Test Travel"
},{
"task_code": "A15400",
"lastname" : "ENG024b PM FFS1 Test Travel"
}
]}