开发者

extjs bbar filter not working as desired?

Is this the correct syntax for dynamically adding a filter to a bottom toolbar of gridpanel?

this.Grid.getBottomToolbar().plugins=[filters];

There are no errors when I do this. But it does not behave as promised. i.e. the paging does not reset to 1 when the filter is fired. SoI load the page, go to page 2, then change the filter and there is only 1 record(say). It shows: page 2 of 1 because the paging is not reset.

Is my syntax correct?

The docs say:

Paging : If specified as a plugin to the grid's configured PagingToolbar, the current page will be reset to page 1 开发者_JS百科whenever you update the filter.


this is not the correct way no ... you should attach your filters when creating your instance of the bottom toolbar, you are adding it to he plugins array probably after it has already been created and that's too late for the grid to register the plugin behaviour on itself.

var filterPlugin = new Ext.ux.grid.FilterPlugin();

var myGrid = new Ext.grid.GridPanel({
     store : store
    ,columns : columns
    ,sm : new Ext.grid.RowSelectionModel({singleSelect:true})
    ,bbar : new Ext.PagingToolbar({
         pageSize : this.perPage
        ,store : store
        ,plugins: [ filterPlugin ]
    })
});
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜