Results 1 to 3 of 3

Thread: [2.0??] GridPanel

  1. #1
    Ext User
    Join Date
    Nov 2007
    Location
    US
    Posts
    55

    Lightbulb [2.0??] GridPanel

    Hi Everyone,
    I am new to ExtJs and I am facing some issue with Grid Panel.
    I want paging control in my grid , I referred the paging.js but by data is their in array but I need to provide paging navigation.
    Here is my simple code
    Code:
      // the DefaultColumnModel expects this blob to define columns. It can be extended to provide
        // custom or reusable ColumnModels
        var colModel = new Ext.grid.ColumnModel([
            {id:'company',header: "Company", width: 160, sortable: true, locked:false, dataIndex: 'company'},
            {header: "Price", width: 75, sortable: true, renderer: Ext.util.Format.usMoney, dataIndex: 'price'},
            {header: "Change", width: 75, sortable: true, renderer: change, dataIndex: 'change'},
            {header: "% Change", width: 75, sortable: true, renderer: pctChange, dataIndex: 'pctChange'},
            {header: "Last Updated", width: 85, sortable: true, renderer: Ext.util.Format.dateRenderer('m/d/Y'), dataIndex: 'lastChange'}
        ]);
    
    
        // create the Grid
        var groupStore = new Ext.data.GroupingStore({
                        reader: rd,
                        data: myData,
                        sortInfo:{field: 'company', direction: "ASC"},
                        groupField:'company'
            });
        var dk = [['11111111111 Co',71.72,0.02,0.03,'9/1 12:00am'],
        ['2222222222 Co',71.72,0.02,0.03,'9/1 12:00am']]
        
        groupStore.loadData(dk,true);
        var grid = new Ext.grid.GridPanel({
             el: 'grid-example',
            ds:groupStore,
            cm: colModel,
            autoExpandColumn: 'company',
               
            title:'Array Grid',
            view: new Ext.grid.GroupingView({
                    forceFit:false,
                    groupTextTpl: '{text} ({[values.rs.length]} {[values.rs.length > 1 ? "Items" : "Item"]})'
                }),
        bbar: new Ext.PagingToolbar({
                    pageSize: 5,
                    store: groupStore,
                    displayInfo: true,
                    displayMsg: 'Displaying topics {0} - {1} of {2}',
                    emptyMsg: "No topics to display",
                 
            }),
                frame:true,
                width: 700,
                height: 250,
                collapsible: true,
                animCollapse: true,
                title: 'Grouping Example',
                iconCls: 'icon-grid',
                
        });
    
        grid.render();
    Last edited by mystix; 28 Nov 2007 at 3:31 AM. Reason: use [code][/code] tags

  2. #2
    Sencha User
    Join Date
    Mar 2007
    Location
    Singapore
    Posts
    6,232

    Default

    Quote Originally Posted by yogeshmsharma View Post
    Hi Everyone,
    I want paging control in my grid , I referred the paging.js but by data is their in array but I need to provide paging navigation.
    please provide a clearer explanation.

    p.s. please post other details as per https://forum.sencha.com/forum/showthread.php?t=13985. thanks.

  3. #3
    Sencha User
    Join Date
    Mar 2007
    Posts
    7,854

    Default

    This certainly doesn't appear to be a Bug - moved to Help.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •