radtad
1 Feb 2008, 3:40 PM
Ok, so I cant seem to figure out why the data won't load in this script. It returns data from the url in an array format. If there is thread out there with this info please point me in the right direction ( I can't seem to find one at this point).
Ext.onReady(function(){
Ext.QuickTips.init();
var xg = Ext.grid;
// shared reader
var reader = new Ext.data.ArrayReader({}, [
{name: 'date', type: 'date', dateFormat: 'd/m/Y'},
{name: 'job'},
{name: 'task'},
{name: 'linenum', type: 'float'},
{name: 'name'},
{name: 'uname'},
{name: 'location'},
{name: 'hours', type: 'float'}
]);
var grid = new xg.GridPanel({
store: new Ext.data.GroupingStore({
proxy: new Ext.data.HttpProxy({
method: 'POST',
url: "/blah",
}),
reader: reader,
sortInfo:{field: 'date', direction: "ASC"},
groupField:'date'
}),
columns: [
{id:'date',header: "Date", width: 60, sortable: true, renderer: Ext.util.Format.dateRenderer('m/d/Y'), dataIndex: 'date'},
{header: "Job", width: 20, sortable: true, dataIndex: 'job'},
{header: "Task", width: 20, sortable: true, dataIndex: 'task'},
{header: "LineNum", width: 20, sortable: true, dataIndex: 'linenum'},
{header: "Name", width: 20, sortable: true, dataIndex: 'name'},
{header: "User Name", width: 20, sortable: true, dataIndex: 'uname'},
{header: "Location", width: 20, sortable: true, dataIndex: 'location'},
{header: "Hours", width: 20, sortable: true, dataIndex: 'hours'}
],
view: new Ext.grid.GroupingView({
forceFit:true,
groupTextTpl: '{text} ({[values.rs.length]} {[values.rs.length > 1 ? "Items" : "Item"]})'
}),
frame:true,
width: 700,
height: 450,
collapsible: true,
animCollapse: false,
title: 'Grouping Example',
iconCls: 'icon-grid',
renderTo: document.body
});
grid.load();
});
Also, I can't seem to make this data display using an AJAX function call. Any suggestions on how to return the data correctly into the grid?
Thanks
Ext.onReady(function(){
Ext.QuickTips.init();
var xg = Ext.grid;
// shared reader
var reader = new Ext.data.ArrayReader({}, [
{name: 'date', type: 'date', dateFormat: 'd/m/Y'},
{name: 'job'},
{name: 'task'},
{name: 'linenum', type: 'float'},
{name: 'name'},
{name: 'uname'},
{name: 'location'},
{name: 'hours', type: 'float'}
]);
var grid = new xg.GridPanel({
store: new Ext.data.GroupingStore({
proxy: new Ext.data.HttpProxy({
method: 'POST',
url: "/blah",
}),
reader: reader,
sortInfo:{field: 'date', direction: "ASC"},
groupField:'date'
}),
columns: [
{id:'date',header: "Date", width: 60, sortable: true, renderer: Ext.util.Format.dateRenderer('m/d/Y'), dataIndex: 'date'},
{header: "Job", width: 20, sortable: true, dataIndex: 'job'},
{header: "Task", width: 20, sortable: true, dataIndex: 'task'},
{header: "LineNum", width: 20, sortable: true, dataIndex: 'linenum'},
{header: "Name", width: 20, sortable: true, dataIndex: 'name'},
{header: "User Name", width: 20, sortable: true, dataIndex: 'uname'},
{header: "Location", width: 20, sortable: true, dataIndex: 'location'},
{header: "Hours", width: 20, sortable: true, dataIndex: 'hours'}
],
view: new Ext.grid.GroupingView({
forceFit:true,
groupTextTpl: '{text} ({[values.rs.length]} {[values.rs.length > 1 ? "Items" : "Item"]})'
}),
frame:true,
width: 700,
height: 450,
collapsible: true,
animCollapse: false,
title: 'Grouping Example',
iconCls: 'icon-grid',
renderTo: document.body
});
grid.load();
});
Also, I can't seem to make this data display using an AJAX function call. Any suggestions on how to return the data correctly into the grid?
Thanks