Enable client-side filtering in jqGrid's TreeGrid

[亡魂溺海] 提交于 2019-12-11 09:30:37

问题


With TreeGrid enabled in jqGrid, how can one create a work-around or customize the jqGrid source code so that the filter toolbar works properly on the client side?

Out of the box, having TreeGrid enabled disables client-side filtering, paging, and client-side sorting. I was able to make simply adjustments to the jqGrid source code to solve the latter two issues.


回答1:


The main problem with filtering of tree grid is just it's not clear what should be displayed as the result of filtering. I try to explain it on an example. Let us we have a tree with

+root
    +testchild1
        test1
    +child2
        test2

and you filter for the word "test". What should be displayed? Should be displayed the tree below?

    +testchild1
        test1
        test2

or the original tree stay be unfiltered?

If you do know exactly want should be displayed in the grid after the filtering you can implement the hiding of the unneeded rows manually. You can use beforeSearch callback. You can modify the code from the answer for example.



来源:https://stackoverflow.com/questions/9397657/enable-client-side-filtering-in-jqgrids-treegrid

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!