Hybrid View

  1. #1
    Sencha User
    Join Date
    Jun 2012
    Posts
    2
    Vote Rating
    0
    sufyankhan is on a distinguished road

      0  

    Default Unable to view the last few rows of a grid

    Unable to view the last few rows of a grid


    Hello folks,

    This is my first post on this site. I have been hooked to ExtJS for the past few months. While everything works like a charm, I just realized a strange issue while implementing grid. When a grid has a horizontal scroll bar, the last row simply does not display. At first I thought I might not be fetching the data properly. But that is not the case. The data which is in json format has say 81 results, but displays only 80 results. When I inspect element using Firebug, I can view the 81st row, but for some reason its hidden behind the scroll bar. Further if I try adding dockedItems to the grid panel, the view further reduces to 79. Kindly let me know if I am doing any thing wrong here

    PHP Code:
    var createGrid = function(columndataproduct_id) {
            
    grid Ext.create('Ext.grid.Panel', {
                
    id'product-form',
                
    cls'product-grid',
                
    height:480,
                
    margin'10 10 0 10',
                
    border:false,
                
    storestore,
                
    columns: [
                    {
    xtype'rownumberer' /*, height:70 Would reduce another 3 rows*/},
                    
    columndata
                
    ],
                
    stripeRowstrue,
                
    /*Would reduce another 1 row
                    dockedItems: [{
                    xtype: 'toolbar',
                    cls: 'customTab gridHead',
                    items: [{
                        text: 'New Product',
                        cls:'advbutton',
                        margin: '2 0 2 5',
                        handler: function(){
                            newpopup(product_id);
                        }
                    }]
                }],*/
                
    renderTo'productDiv'
            
    });
            
    grid.reconfigure(nullgrid.initialConfig.columns);

    PHP Code:
    var createStore = function(fielddatavalues) {
            
    store Ext.create('Ext.data.ArrayStore', {
                
    fieldsfielddata,
                
    datavalues
            
    });

    PHP Code:
    Ext.Ajax.request({
            
    url'/Products/view',
            
    success: function(response){
                var 
    data Ext.decode(response.responseText);
                
    createStore(data.fielddatadata.data);
                
    createGrid(data.headerdata.product_id);
            }
    }); 

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,227
    Vote Rating
    859
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    What Ext JS 4.x.x version and OS/Browser are you using?
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Jun 2012
    Posts
    2
    Vote Rating
    0
    sufyankhan is on a distinguished road

      0  

    Default


    Extjs Version 4.0.7
    Firefox 17.0

    I have been able to find out what went wrong. Grid.reconfigure causes this problem. I was using reconfigure because my columns were not being displayed in the correct order. For example, the rownumberer would appear as the 5th column. Further the horizontal scrollbars would not appear in grids. A little more study revealed that one should not assign same id to multiple grids, even if the grids are on different pages. That is what was wrong at my end. Extjs stores the grid columns in cookies based on grid id. Now I have different ids for all my grids in the application.

    However, I am not sure why Grid.reconfigure causes the problem which I reported. Also I would like to know if assigning different id to grids in one application the only way to work, or is there a work around?

Thread Participants: 1