1. #1
    Ext User
    Join Date
    Feb 2008
    Posts
    6
    Vote Rating
    0
    piyush is on a distinguished road

      0  

    Default Just Check my code

    Just Check my code


    i m create grouing with sorting example.
    it is work perfectly but when i put paging functionality,it was not work properly...
    data is not display with proper grouping...

    i send my code pls review it and pls pls help me...

    i need paging,sorting,grouping in extjsgrid....

    /******************************************************************************************************/
    //Ext.onReady(function(){
    var HomeGrid = {
    init: function(){
    var primaryKey = 'Groupid';
    var ps = 10;
    Ext.QuickTips.init();

    var js = new Ext.data.JsonStore({
    url: 'ExtGetData.aspx',
    baseParams:{task: "HomeGrid"},
    root: 'data',
    id: 'Groupid',
    fields: [
    {name: 'GroupID', mapping: 'GroupID'},
    {name: 'MainGroupName', mapping: 'MainGroupName'},
    {name: 'GroupLevel', mapping: 'GroupLevel'},
    {name: 'TpaGroupID', mapping: 'tpagroupid'},
    {name: 'GroupName', mapping: 'GroupName'},
    {name: 'GroupLevelDescr', mapping: 'GroupLevelDescription'},
    {name: 'Website', mapping: 'Website'},
    {name: 'GroupStatus', mapping: 'GroupStatus'},
    {name: 'City', mapping: 'city'},
    {name: 'State', mapping: 'stateid'}

    ]
    });


    js.on('load',function()
    {
    var ds = new Ext.data.GroupingStore({
    sortInfo:{field: 'MainGroupName', direction: "ASC"},
    groupField:'MainGroupName',
    proxy: new Ext.ux.data.PagingMemoryProxy(js.reader.jsonData),
    reader: js.reader
    });


    var sm = new Ext.grid.RowSelectionModel({
    singleSelect:true
    });

    // Define Column Model of the Grid
    var cm = new Ext.grid.ColumnModel([
    {id:'MainGroupName',header: 'MainGroupName', hidden: true, dataIndex: 'MainGroupName'},
    //{header: 'MainGroupName', dataIndex: 'MainGroupName', hidden:true},
    {header: 'Client Name', dataIndex: 'GroupName', sortable: true,renderer: renderGroup},
    {header: 'Address City', dataIndex: 'City', sortable: true},
    {header: 'Address State', dataIndex: 'State', sortable: true},
    {header: 'GroupLevel', dataIndex: 'GroupLevelDescr', sortable: true},
    {header: 'Status', dataIndex: 'GroupStatus', sortable: true} //renderer: Ext.util.Format.usMoney

    ]);

    // Define Paging Toolbar for the Grid
    /* var paging = new Ext.PagingToolbar({
    pageSize: ps,
    store: ds,
    displayInfo: true,
    displayMsg: 'Displaying Groups {0} - {1} of {2}',
    emptyMsg: "No Groups to display"
    });*/



    var myGrid = new Ext.grid.GridPanel({
    el:'home-grid',
    store: ds,
    view: new Ext.grid.GroupingView({
    forceFit:true,
    groupTextTpl: '{text} ({[values.rs.length]} {[values.rs.length > 1 ? "Items" : "Item"]})'
    }),
    id: 'HomeGrid',
    cm: cm,
    collapsible: true,
    animCollapse: false,
    title: 'GroupGrid',
    width:750,
    height: 400,
    loadMask: true,
    sm: sm,
    stripeRows: true//,
    //bbar: paging
    });

    myGrid.render();
    ds.load({params:{start:0}});
    //ds.load({params:{start:0, limit:ps}});
    }); // js.on

    js.load();

    // pluggable renders
    function renderGroup(value, p, record){

    return String.format('<a href="javascript:ViewGroup(\'{0}\',{1},\'{2}\')">{0}</a>',value,record.data.GroupID,record.data.GroupLevel);

    }

    function renderSelect(value, p, record){
    return String.format('<a href="javascript:SelectGroup(\'{0}\',{1},\'{2}\')">Select</a>','Select',record.data.GroupID,record.data.GroupLevel);

    }



    } // init function end
    }; // var pendingclaims end

    Ext.onReady(HomeGrid.init, HomeGrid);

  2. #2
    Ext User
    Join Date
    Jul 2007
    Location
    Florida
    Posts
    9,996
    Vote Rating
    6
    mjlecomte will become famous soon enough mjlecomte will become famous soon enough

      0  

    Default


    Please see example and FAQ in my signature. Please post inside code tags as well (see the thread on how to ask a question effectively).

  3. #3
    Ext User
    Join Date
    Feb 2008
    Posts
    6
    Vote Rating
    0
    piyush is on a distinguished road

      0  

    Default Help

    Help


    pls send me link of one example with paging,grouping and sorting...

    i need it..

  4. #4
    Ext User
    Join Date
    Jul 2007
    Location
    Florida
    Posts
    9,996
    Vote Rating
    6
    mjlecomte will become famous soon enough mjlecomte will become famous soon enough

      0  

    Default


    Quote Originally Posted by mjlecomte View Post
    Please see example and FAQ in my signature. Please post inside code tags as well (see the thread on how to ask a question effectively).
    I already stated where to look.

Thread Participants: 1