Gelmiş geçmiş en büyük porno sitemiz olan 2pe de her zaman en kaliteli pornoları sunmayı hedefledik. Diğer video sitemiz olan vuam da ise hd porno ağırlıklı çalışmalara başladık.

  1. #1
    Sencha User
    Join Date
    Apr 2012
    Posts
    15
    Vote Rating
    0
    fabbydesign is on a distinguished road

      0  

    Default Can't get selected row from grid

    Can't get selected row from grid


    Hello. For two days i try to resolve the problem and i didn't find the response.
    On the above code, how can i get the selected row when you click the button Remove subpage? I tryed with getSelectionModel() but i get an error.
    Thanks
    Wait your response.


    Code:
    listTextSubPages: { //list subpages
                title: 'Subpages List',
                id: 'listSubpages',
                layout: 'fit',
                bodyPadding: 0,
                items: [
                    Ext.create('Ext.grid.Panel', {
                        itemId:'gridSubpagesList',
                        columns: [
                            {text: "ID", dataIndex: 'objid', align: 'center', width:50, hidden: true},
                            {text: "Name", width: 200, dataIndex: 'name', sortable: true},
                            {text: "Short Description", flex: 1, width: 380, dataIndex: 'sDescription', sortable: true},
                            {text: "Last update", width: 130, dataIndex: 'lastUpdate', sortable: true}
                        ],
                       store : new Ext.data.JsonStore({
                            storeId:'storeTextSubPages',
                            fields:['objid','name', 'sDescription', 'lastUpdate'],
                            autoLoad: true,
                            proxy:{
                                url:'showtextsubpages/cities',
                                type:'ajax',
                                reader:{
                                    root:'data',
                                    type:'json'
                                }
                            }
                        }),
                        listeners: {
                            itemdblclick:function(view, record, item, index, e ) {
                                var rowID = record.get('objid');
                                
                                Ext.getCmp('content-panel').layout.setActiveItem('edit-subPages-panel');//load subpages list
                                
                                param=getSelectedMenu();
                                var content=Ext.getCmp('edit-subPages-panel');
                                content.down('form').getForm().load({url:'showtextsubpages/'+param+'/'+rowID});
                            }
                        }
                        
                    })
                ],
                dockedItems: [
                    {
                        xtype: 'toolbar',
                        ignoreParentFrame: true,
                        ignoreBorderManagement: true,
                        cls: 'absolute-form-toolbar',
                        items: [
                            {
                                text: 'Add subpage',
                                iconCls: 'icon-add',
                                handler:function(){
                                    Ext.MessageBox.prompt('Insert new data', 'Please enter the name:', showResultText);
    
    
                                    function showResultText(btn, text){//add data
                                        var param=getSelectedMenu();
                                        Ext.Ajax.request({
                                            url: 'showtextsubpagesadd',
                                            success: function(){
    
    
                                            },   // function called on success
                                            failure: function(){
    
    
                                            },
                                            params: { param: param, action: btn, name:text }  // your json data
                                            });
    
    
                                    };
    
    
                                },
                            },{
                                text: 'Remove subpage',
                                iconCls: 'icon-remove',
                                handler: function() {
                                     //gere is the problem
                                }
                            }
                        ]
                    }
                ]
                
            }

  2. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    8,865
    Vote Rating
    438
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      0  

    Default


    There are several methods:

    Code:
    myGrid.getSelectionModel().getSelection()[0]; // for use in button
    
    // global listener for class
    this.grid.getSelectionModel().on('select', function(selModel, model, idx) {
        // your code here
    }, this);
    Regards,
    Scott.

  3. #3
    Sencha User
    Join Date
    Apr 2012
    Posts
    15
    Vote Rating
    0
    fabbydesign is on a distinguished road

      0  

    Default


    thanks for helping me!

    so, if i put

    Code:
    handler: function() {
                                    var grid = this.grid.getSelectionModel().getSelection()[0];
                                    console.log(grid);
                                }
    i get the message:

    TypeError: Cannot call method 'getSelectionModel' of undefined [http://www.mallorcainfo.de/media/ExtJS/resources1/js/textPages.js:214]if i try:
    Code:
    handler: function() {
         var grid = Ext.getCmp('listSubpages').getSelectionModel().getSelection()[0];
         console.log(grid);
    }
    i get the error:
    TypeError: Object [object Object] has no method 'getSelectionModel' [http://www.mallorcainfo.de/media/ExtJS/resources1/js/textPages.js:214]

  4. #4
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    8,865
    Vote Rating
    438
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      0  

    Default


    You are getting the id of your listTextSubPages (id: 'listSubpages',)

    You will need to get your grid. I see you have itemId, so you will need to get that .. something like:

    Code:
    var list = Ext.getCmp('listSubpages'); // getting id
    var grid = list.down('#gridSubpagesList'); // using itemid of grid
    var row = grid.getSelectionModel().getSelection()[0];
    You can use firebug to view the values of each using breakpoints or console.log and see what is going on in the code.

    Regards,
    Scott.

  5. #5
    Sencha User
    Join Date
    Apr 2012
    Posts
    15
    Vote Rating
    0
    fabbydesign is on a distinguished road

      0  

    Default


    perfect, worked.
    i get then the values with var id=sm.get('objid');
    Thanks alot
    Scott! I will do the rest (deleting from database). Hope will be no problem

  6. #6
    Sencha User
    Join Date
    Apr 2012
    Posts
    15
    Vote Rating
    0
    fabbydesign is on a distinguished road

      0  

    Default


    Hello again.
    I still have a little problem.
    I want, when i press the button Add subpage, to add data to database and into grid.
    So, i made to add into database, the problem, is that i want to show the data instantly and in the grid.

    So, to do this, i tried:

    Code:
    success: function(){
                                                
                                                var list = Ext.getCmp('listSubpages'); // getting id
                                                var grid = list.down('#gridSubpagesList'); // using itemid of grid
                                                grid.getView().refresh(true);
    
    
                                                
                                            }
    but won't refresh it...and is not any error

  7. #7
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    8,865
    Vote Rating
    438
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      0  

    Default


    Try: grid.store.load();

    Scott.

  8. #8
    Sencha User
    Join Date
    Apr 2012
    Posts
    15
    Vote Rating
    0
    fabbydesign is on a distinguished road

      0  

    Default


    that worked.
    thanks

  9. #9
    Sencha User
    Join Date
    Nov 2012
    Location
    Banglore.
    Posts
    6
    Vote Rating
    0
    shashidhar.gr is on a distinguished road

      0  

    Default Thank you Mr.scott ..

    Thank you Mr.scott ..


    thank you scottmartin and fabbydesign .. your discussion helped me to solve my problem ..

Thread Participants: 2