PDA

View Full Version : Problem in Grouping Grid Data



parminder
3 Mar 2010, 4:21 AM
Hi friends

i am facing one problem while trying to load data into grouping grid....
i got the data from backend but i m nt able to load it into grid....:((

*********CODE***********

Ext.onReady(function(){
Ext.QuickTips.init();

var xg = Ext.grid;

var reader = new Ext.data.ArrayReader({}, [
{name: 'section_head1'},
{name: 'set_particulars1'},
{name: 'set_nos1'},
{name: 'set_length1', type: 'double'},
{name: 'set_breadth1', type:'double'},
{name: 'set_height1', type:'double'},
{name: 'set_qty1', type:'double'}
]);

var store = new Ext.data.GroupingStore({
reader: reader,
url : 'raajax.htm?controller=loadSectionGrid',
sortInfo:{field: 'section_head1', direction: "ASC"},
groupField:'section_head1',
remoteGroup:true,
remoteSort:true
});

var grid = new xg.GridPanel({
store: store,
frame: true,
height: 397,
title: 'Measurement Detailed Sheet',
columns: [
//{id:'section_head1',header: "Section", width: 60, sortable: true, dataIndex: 'section_head1'},
{id:'set_particulars1', header: "Particulars", width: 20, sortable: true, dataIndex: 'set_particulars1'},
{id:'set_nos1', header: "Nos", width: 20, sortable: true, dataIndex: 'set_nos1'},
{id:'set_length1',header: "Length", width: 20, sortable: true, dataIndex: 'set_length1'},
{id:'set_breadth1',header: "Breadth", width: 20, sortable: true, dataIndex: 'set_breadth1'},
{id:'set_height1',header: "Height", width: 20, sortable: true, dataIndex: 'set_height1'},
{id:'set_qty1',header: "Quantity", width: 20, sortable: true, dataIndex: 'set_qty1'}
],
view: new Ext.grid.GroupingView({
forceFit:true,
groupTextTpl: '{text} ({[values.rs.length]} {[values.rs.length > 1 ? "Items" : "Item"]})'
}),
});
grid.store.load({
params:{
bill_detail_id:rabill_detail_id,
},
});

getRaBillHeaderHandler();

var login_form = new Ext.FormPanel({
bodtStyle : 'Width:100%;',
//bodyStyle:'padding:5px 5px 5px 5px',
renderTo: 'container',
frame:true,
items:[rabill_header,grid]
});
});

**************************

Result set from backend.......

{"LoadData":[{"set_breadth1":"1.0","set_qty1":"1.0","set_particulars1":"A1","set_nos1":"1x1x1","set_length1":"1.0","section_head1":"asdf","set_height1":"1.0"},{"set_breadth1":"1.0","set_qty1":"1.0","set_particulars1":"A1","set_nos1":"1x1x1","set_length1":"1.0","section_head1":"asdf","set_height1":"1.0"},
{"set_breadth1":"2.0","set_qty1":"64.0","set_particulars1":"A2","set_nos1":"2x2x2","set_length1":"2.0","section_head1":"asdf","set_height1":"2.0"});

what is wrong here i m seriously pissed of with this issue .....:((:((