1. #1
    Ext User
    Join Date
    Apr 2009
    Posts
    7
    Vote Rating
    0
    megmefleg is on a distinguished road

      0  

    Exclamation Problem with GridPanel Selection => this.getRow(row) is undefined

    Problem with GridPanel Selection => this.getRow(row) is undefined


    Hi,

    In my application, I've got a main TabPanel which each tab is filled by an action launched by clicking on a tree's node.
    The tree node actions are diffreent so the content of the tabs could be different ( in its structure)
    Each tab contains a least a grid panel.
    When I click on a cell of this GridPanel, this action will update the rest of the Parent Panel (I hope, I'm enough clear).
    Please look at the screenshots.

    My problem is as follow:
    In the first tab, I can have for example 6 rows in the gridPanel and in an other tab, the gridPanel will contain 1 row.
    If I click alternatively on the different grids, I have the following troubles:

    - A cell remains selected in on tab, and I cannot select a new cell in an other tab

    - Systematically, the following error message finally appears:

    PHP Code:
    this.getRow(rowis undefined
           
    return this.getRow(row).getElementsByTagName('td')[col]; 
    I made a lot of tests, but I found nothing. I guess that the problem comes from the CellSelectionModel.

    How Can I manage these multiple GridPanels and their selections?

    Thank you for your help.


    Please find the code of my GridPAnel Class:

    PHP Code:
    Ext.namespace('PDM');

    PDM.GridPanel Ext.extend(Ext.grid.GridPanel, {
        
    //region:'north'
        
    splittrue,
        
    collapsibletrue,
        
    collapseMode'mini',
        
    margins'5 5 0 5',
        
    sm: new Ext.grid.CellSelectionModel({
            
    singleSelecttrue,
            
    //                        listeners:{
            //                            cellselect:{
            //                                fn: function(grid,record,cellIndex){
            //                                        console.log(this.getSelectedCell());
            //                                        var fieldName = this.grid.getColumnModel().getDataIndex(cellIndex);
            //                                        console.log(fieldName);
            //                                        
            //                                        var data = this.selection.record.get(fieldName);
            //                                        console.log(data);
            //                                        
            //                                        
            //                                        if(typeof data.href != "undefined"){
            //                                            var tab = Ext.ComponentMgr.get('mainPanel');
            //                    
            //                                            tab.updateContainer(data.href);
            //                                            this.clearSelections();
            //                
            //                                    }
            //                                }
            //                            }    
            //                        }
        
    }),
        
    stripeRowstrue,
        
    height125,
        
    maxHeight600,
        
    overflowtrue,
        
    borderfalse
        
    //,frame: true
        
    ,
        
    viewConfig: {
            
    forceFittrue
        
    }

        ,
        
    initComponent: function() {

            
    // call parent
            
    PDM.GridPanel.superclass.initComponent.apply(thisarguments);

            
    this.columnName Ext.data.Record.create(this.data.columns);

            
    this.store = new Ext.data.Store({
                
    proxy: new Ext.data.MemoryProxy(this.data),
                
    reader: new Ext.data.JsonReader({
                    
    totalProperty"total",
                    
    root"list"
                
    },
                
    this.columnName),
                
    autoLoadtrue
            
    });

            function 
    cellValue(val) {
                if (
    typeof val.value != "undefined") {
                    return 
    '<img style="cursor:pointer;" src="img/asterisk_yellow.png"></img>';
                } else {
                    return 
    '<center> - </center>';
                }
            }
            
    this.colModel = new Ext.grid.ColumnModel([{
                
    header'Indice',
                
    align'center',
                
    sortabletrue,
                
    dataIndex'indice',
                
    idthis.id '-indice'
            
    },
            {
                
    header'Dossier Produit',
                
    sortabletrue,
                
    align'center',
                
    renderercellValue,
                
    dataIndex'wo_PD',
                
    idthis.id '-wo_PD'
            
    },
            {
                
    header'Contre Proposition',
                
    sortabletrue,
                
    align'center',
                
    renderercellValue,
                
    dataIndex'wo_CP',
                
    idthis.id '-wo_CP'
            
    },
            {
                
    header'Transfert',
                
    sortabletrue,
                
    align'center',
                
    dataIndex'wo_transf',
                
    idthis.id '-wo_transf'
            
    }]);

        }

    }); 
    Attached Images

  2. #2
    Ext User
    Join Date
    Apr 2009
    Posts
    7
    Vote Rating
    0
    megmefleg is on a distinguished road

      0  

    Default => Problem with GridPanle (CellSelectionModel)

    => Problem with GridPanle (CellSelectionModel)


    I have investigated on my problem and I have prepared a little example which reproduces it.

    Hereafter the code:
    PHP Code:
    Ext.ns('Example');

    Ext.BLANK_IMAGE_URL '../../library/extjs/resources/images/default/s.gif';

    // example grid 
    Example.Grid Ext.extend(Ext.grid.GridPanel, {
        
    data: [],
        
    sm: new Ext.grid.CellSelectionModel({
            
    singleSelecttrue
        
    }),
        
    initComponent: function() {
            
    // call parent
            
    Example.Grid.superclass.initComponent.apply(thisarguments);

            var 
    config = {
                
    store: new Ext.data.SimpleStore({
                    
    fields: [{
                        
    name'company'
                    
    },
                    {
                        
    name'price',
                        
    type'float'
                    
    },
                    {
                        
    name'industry'
                    
    }],
                    
    datathis.data
                
    }),
                
    colModel: new Ext.grid.ColumnModel([{
                    
    id'company',
                    
    header"Company",
                    
    width40,
                    
    sortabletrue,
                    
    dataIndex'company'
                
    },
                {
                    
    header"Price",
                    
    width20,
                    
    sortabletrue,
                    
    rendererExt.util.Format.usMoney,
                    
    dataIndex'price'
                
    }]),
                
    viewConfig: {
                    
    forceFittrue,
                }
            }; 
    // eo config object
            // apply config
            
    Ext.apply(thisExt.apply(this.initialConfigconfig));

        } 
    // eo function initComponent
    });

    var 
    data1 = [['3m Co'71.72'Manufacturing'], ['Alcoa Inc'29.01'Manufacturing'], ['Altria Group Inc'83.81'Manufacturing'], ['American Express Company'52.55'Finance'], ['American International Group, Inc.'64.13'Services'], ['AT&T Inc.'31.61'Services']]

    var 
    data2 = [['Boeing Co.'75.43'Manufacturing'], ['Caterpillar Inc.'67.27'Services']]

    var 
    data3 = [['3m Co'71.72'Manufacturing'], ['Alcoa Inc'29.01'Manufacturing'], ['Altria Group Inc'83.81'Manufacturing'], ['American Express Company'52.55'Finance'], ['American International Group, Inc.'64.13'Services'], ['AT&T Inc.'31.61'Services'], ['Boeing Co.'75.43'Manufacturing'], ['Caterpillar Inc.'67.27'Services']]

    // application main entry point
    Ext.onReady(function() {

        
    Ext.QuickTips.init();

        
    // create and show window
        
    var win = new Ext.Window({
            
    renderToExt.getBody(),
            
    titleExt.get('page-title').dom.innerHTML,
            
    width400,
            
    height300,
            
    plaintrue,
            
    layout'fit',
            
    borderfalse,
            
    closablefalse,
            
    items: [{
                
    xtype'tabpanel',
                
    defaults: {
                    
    layout'fit'
                
    },
                
    activeItem0,
                
    items: [{
                    
    title'Grid Tab 1',
                    
    id'gridtab1',
                    
    items: [new Example.Grid({
                        
    datadata1
                    
    })]
                },
                {
                    
    title'Grid Tab 2',
                    
    id'gridtab2',
                    
    items: [new Example.Grid({
                        
    datadata2
                    
    })]

                },
                {
                    
    title'Grid Tab 3',
                    
    id'gridtab3',
                    
    items: [new Example.Grid({
                        
    datadata3
                    
    })]

                }]
            }]
        });
        
    win.show();

    }); 
    // eo function onReady
    // eof 
    If you play with it, you can select a cell in the first active tab but in the other tabs, it is impossible to select them.
    Why?

    Finally, the error message appears:
    Code:
    this.getRow(row) is undefined
    Can you help me to manage the selected cell in the different tabs?

    Thank in advance

  3. #3
    Ext User
    Join Date
    Apr 2009
    Posts
    7
    Vote Rating
    0
    megmefleg is on a distinguished road

      0  

    Default [BUG]: Ext.grid.CellSelectionModel: problem of selection in TabPanel

    [BUG]: Ext.grid.CellSelectionModel: problem of selection in TabPanel


    Just to share my investigation on my problem.
    This problem seems come from the SelModel type.
    In the example, I used:

    PHP Code:
            ,sm: new Ext.grid.CellSelectionModel({
                            
    singleSelecttrue}) 
    If I use the Ext.grid.RowSelectionModel, there are no more problems.

    I can have different selection in different tabs.
    But, when I am using Ext.grid.CellSelectionModel, the multi selection problem appears with
    an error message.

  4. #4
    Ext User
    Join Date
    May 2009
    Posts
    13
    Vote Rating
    0
    Jazor is on a distinguished road

      0  

    Default


    I too have experienced this issue.

    I have a TreePanel in a border layout with grids opening up in a TabPanel. For me the first grid loaded works, a new grid inserted into the tab panel works, but after insertion of the new grid, the first grid fails - as described above.

    Looking at the code extract, one similarity is the way sm is declared/defined:

    PHP Code:
    Example.Grid Ext.extend(Ext.grid.GridPanel, {
        
    sm: new Ext.grid.CellSelectionModel({
            
    singleSelecttrue
        
    }),
        
    initComponent: function() {
            
    Example.Grid.superclass.initComponent.apply(thisarguments);
            ...
        },
    ... 
    I avoided the issue by initialising sm within initComponent, before invocation of the super class initComponent.

  5. #5
    Ext User
    Join Date
    Oct 2009
    Posts
    4
    Vote Rating
    0
    finieousFingers is on a distinguished road

      0  

    Default


    Jazor could you please post an example of what worked for you? Thanks so much!

Thread Participants: 2

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar