Tutorial Extjs Grouping

In this section i want to create a example about grouping in grid extjs. Usually grouping used to classifying data which have similarities, In this example i would classify by country. Ok, now i will try to explain more of code from this tutorial .

1. Create grouping store like this code

var SimpleDataStore = new Ext.data.GroupingStore({
     proxy: new Ext.data.HttpProxy({
            url: 'simplegridg.php',
            method: 'POST'
            }),
    reader: new Ext.data.JsonReader({
    root: 'results',
    totalProperty: 'total'

      },
      [
       //this is field in database
        {name: 'id', type: 'int'},
        {name: 'name', type: 'string'},
        {name: 'address', type: 'string'},
        {name: 'email', type: 'string'},
	{name: 'country', type: 'string'}

      ]),
      sortInfo:{field: 'country', direction: "ASC"},
      groupField:'country' // this script used to classify by country
    });

2. In grid panel create code to display the result of grouping. here is code

view: new Ext.grid.GroupingView({
            forceFit:true,
            groupTextTpl: '{text} ({[values.rs.length]} {[values.rs.length > 1 ? "Items" : "Item"]})'
 }),

This is a screen shot of this tutorial

grouping-grid-extjs


Download source code

http://www.ziddu.com/download/9528336/grouping_data_gird.rar.html

Recent Search Term
extjs groupingstore|extjs grid grouping|extjs grouping grid|groupingstore extjs|extjs grouping|ExtJs GroupingStore Example|defafe|Ext grid GroupingView|extjs groupingstore jsonreader|grouping grid extjs|
Popular Search Term gantz 322|plkn semakan calon 2011|morakiacom|read gantz 322|Gantz 322|

2 Responses to “Tutorial Extjs Grouping”

  1. hii

    my grid data is not coming why not getting can you provide me the code of php file..

    so i can check that thanks
    rahul

  2. nice post i really like it

Leave a Reply