extjs3.4 gridpanel rowselect事件无法正常工作

时间:2014-11-28 03:13:22

标签: javascript extjs grid

我有一个网格面板,我正在使用ExtJS 3.4。我想选择一行,然后当我单击更新按钮时,必须在窗口中填充所选行的值。我尝试使用rowselect和rowclick事件,但两者都不起作用。有人能告诉我怎么做。

另外,如何将分页工具栏对齐到屏幕底部?

this.grid= new Ext.grid.GridPanel({
                    layout: 'fit',
                    //autoHeight: true,
                    height: 556,
                    store: store,
                    columns:[
                           {header: "Book Name", dataIndex: 'bookName'},
                           {header: "Author Name", dataIndex: 'authorName'}
                           ],
                    sm: new Ext.grid.RowSelectionModel({singleSelect: true}),
                    bbar: new Ext.PagingToolbar({
                           store: store,  // grid and PagingToolbar using same store
                           displayInfo: true,
                           pageSize: pgSize
                        }),
                    listeners:{
                        'rowselect': function(){ 
                                alert("Here");
                        } 
                    }
        }); 

1 个答案:

答案 0 :(得分:1)

使用getSelectionModel函数获取网格所选行的引用

示例小提琴:https://fiddle.sencha.com/#fiddle/e5l

另外bbar配置应该在面板底部显示工具栏,不确定你面临的问题..