在jqGrid的TreeGrid中启用客户端过滤 [英] Enable client-side filtering in jqGrid's TreeGrid

查看:84
本文介绍了在jqGrid的TreeGrid中启用客户端过滤的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在jqGrid中启用TreeGrid后,如何创建替代方法或自定义jqGrid源代码,以便过滤器工具栏在客户端正常工作?

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?

开箱即用,启用TreeGrid会禁用客户端筛选,分页和客户端排序.我能够简单地调整jqGrid源代码来解决后两个问题.

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.

推荐答案

树网格过滤的主要问题只是尚不清楚过滤结果应显示什么.我试图通过一个例子来解释它.让我们有一棵树

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

,然后过滤单词"test".应该显示什么?应该显示在下面的树上吗?

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

    +testchild1
        test1
        test2

还是原始树不被过滤?

如果您确实知道过滤后确实希望显示在网格中,则可以手动隐藏不需要的行.您可以使用 beforeSearch 回调.例如,您可以从答案中修改代码.

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.

这篇关于在jqGrid的TreeGrid中启用客户端过滤的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆