1. #1
    Sencha User discmode's Avatar
    Join Date
    Jun 2009
    Posts
    16
    Vote Rating
    0
    discmode is on a distinguished road

      0  

    Default The case of the missing paging toolbar

    The case of the missing paging toolbar


    Good morning,

    I created a grid with a paging toolbar, and when I had it working as planned I created a grid class and registered an xtype. But when I add the xtype to a viewport, the grid populates but the paging toolbar is mysteriously absent. I've spent a few hours on this problem and I'm sure it's something completely obvious I've been overlooking. Below is the grid class and the calling function, with most of the columns and fields excluded.

    I really would appreciate another set of eyes. Thanks!


    Code:
     Ext.ns('NAPP.gridpanel');
      
      NAPP.gridpanel.MainGridPanel = Ext.extend(Ext.grid.GridPanel, {
          columns: [
              {
                  header: "row", dataIndex: 'row', width: 30, sortable: false
              }, 
      
              {
                  header: "rep", dataIndex: 'rep', width: 125, sortable: true
              }
              ],
      
         viewConfig: {
              bbar: new Ext.PagingToolbar({
                  store: this.buildStore,
                  pageSize: 20,
                  displayInfo: true
              })
          },
      
          initComponent: function () {
              this.store = this.buildStore();
              NAPP.gridpanel.MainGridPanel.superclass.initComponent.call(this);
          },
      
          buildStore: function () {
              var cookieUtil = Ext.util.Cookies;
              var uid = parseInt(cookieUtil.get("ud"));
              var scd = parseInt(cookieUtil.get("scd"));
              return {
                  xtype: 'directstore',
                  directFn: Direct.Grid.LoadPlan,
                  paramOrder: ['userid', 'scode', 'sort', 'dir', 'start', 'limit'],
                  remoteSort: true,
                  totalProperty: 'total',
                  autoLoad: { params: { start: 0, limit: 20} },
                  root: 'data',
                  baseParams: { userid: uid, scode: scd },
                  sortInfo: {
                      field: '0',
                      direction: 'ASC'
                  },
                  fields: [
          {
              type: 'int',
              name: 'row'
          }, 
      
      {
              type: 'string',
              name: 'rep'
          }
          ]
                };
          }
        });
      
      Ext.reg('maingrid', NAPP.gridpanel.MainGridPanel);
    This is the calling function:
    Code:
        buildGridPanel: function () {
            return {
                xtype: 'maingrid',
                itemId: 'mainGrid',
                loadMask: true,
                frame: true,
                height: 300,
                width: 400
            };
        }
    


  2. #2
    Sencha User discmode's Avatar
    Join Date
    Jun 2009
    Posts
    16
    Vote Rating
    0
    discmode is on a distinguished road

      0  

    Default paging bar showing but not connecting to store

    paging bar showing but not connecting to store


    I made changes to the code and the paging toolbar loads, but it's not connecting to the store. Any ideas why it's not reading the store?

    Code:
    Ext.ns('NAPP.gridpanel');
    
    NAPP.gridpanel.MainGridPanel = Ext.extend(Ext.grid.GridPanel, {
        columns: [
            {
                header: "row", dataIndex: 'row', width: 30, sortable: false
            }, ...{
                header: "rep", dataIndex: 'rep', width: 125, sortable: true
            }
            ],
    
        initComponent: function () {
            this.store = this.buildStore();
            NAPP.gridpanel.MainGridPanel.superclass.initComponent.call(this);
        },
    
          bbar: new Ext.PagingToolbar({
                store: this.store,
                pageSize: 20,
                displayInfo: true,
                emptyMsg: 'no records'
            }),
    
        buildStore: function () {
            var cookieUtil = Ext.util.Cookies;
            var uid = parseInt(cookieUtil.get("ud"));
            var scd = parseInt(cookieUtil.get("scd"));
            return {
                xtype: 'directstore',
                directFn: Direct.Grid.LoadPlan,
                paramOrder: ['userid', 'scode', 'sort', 'dir', 'start', 'limit'],
                remoteSort: true,
                totalProprty: 'total',
                autoLoad: { params: { start: 0, limit: 20} },
                root: 'data',
                baseParams: { userid: uid, scode: scd },
                sortInfo: { field: '0', direction: 'ASC' },
                fields: [
        {
            type: 'int',
            name: 'row'
        }, ...{
            type: 'string',
            name: 'rep'
        }
        ]
    
            };
        }
    });
    
    Ext.reg('maingrid', NAPP.gridpanel.MainGridPanel);

  3. #3
    Sencha User brittongr's Avatar
    Join Date
    Jun 2007
    Location
    Panama
    Posts
    109
    Vote Rating
    3
    brittongr is on a distinguished road

      0  

    Default


    Try this:

    Remove bbar property and assign it inside initComponent()
    Code:
    initComponent: function () {
        this.store = this.buildStore();
        Ext.apply(this,
        {
            bbar: new Ext.PagingToolbar({
                store: this.store,
                pageSize: 20,
                displayInfo: true,
                emptyMsg: 'no records'
        })
        };
      NAPP.gridpanel.MainGridPanel.superclass.initComponent.call(this);
    }
    Greivin Britton

    My Extensions:
    Ext.ux.NumericField: Number field with support for currencySymbol, thousand separator, international...
    Ext.ux.PagerSizeSelector: A plugin that allows the change page size with just one click.
    Ext.ux.FieldAccess: A plugin to let the user know which fields are editable.

  4. #4
    Sencha User discmode's Avatar
    Join Date
    Jun 2009
    Posts
    16
    Vote Rating
    0
    discmode is on a distinguished road

      0  

    Default Thank you!

    Thank you!


    Greivin,

    Thank you for taking the time to respond to me. Sometimes I get so wrapped up in a problem I'm unable to see the solution. An extra set of eyes always helps!

  5. #5
    Sencha User brittongr's Avatar
    Join Date
    Jun 2007
    Location
    Panama
    Posts
    109
    Vote Rating
    3
    brittongr is on a distinguished road

      0  

    Default


    That's so true...
    Greivin Britton

    My Extensions:
    Ext.ux.NumericField: Number field with support for currencySymbol, thousand separator, international...
    Ext.ux.PagerSizeSelector: A plugin that allows the change page size with just one click.
    Ext.ux.FieldAccess: A plugin to let the user know which fields are editable.

Similar Threads

  1. TextField - force lower case entries to upper case?
    By Bucs in forum Ext 3.x: Help & Discussion
    Replies: 7
    Last Post: 30 Jun 2010, 3:07 AM
  2. Updating image on toolbar button and paging toolbar issues
    By Jangla in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 9 Jul 2009, 1:21 AM
  3. Replies: 3
    Last Post: 15 Feb 2009, 4:54 PM
  4. paging case of ArrayReader ?
    By newinext in forum Ext 1.x: Help & Discussion
    Replies: 4
    Last Post: 13 Aug 2007, 4:03 AM
  5. Replies: 2
    Last Post: 28 Jun 2007, 6:23 AM

Thread Participants: 1

Tags for this Thread

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi