本文介绍了如何添加的jqGrid随着FilterToolBar过滤Functinality启用了Asp.net的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发了一个jqGrid的显示数据库,现在我需要添加Filtertoolbar在这其中将过滤记录从下拉菜单中...

I developed a Jqgrid to display database and now i need to add Filtertoolbar in it which will filter the record on selecting values from dropdown menu ...

下面是我的code代表的jqGrid ..

Below is my code for Jqgrid..

$(function () {
    $("#UsersGrid").jqGrid({
        url: 'getGriddahico.ashx',
        datatype: 'json',
        height: 250,
        colNames: ['UserID', 'UserName', 'FirstName', 'MiddleName', 'LastName', 'EmailID'],
        colModel: [
                { name: 'UserID', index: 'UserID', width: 100, sortable: true },
                { name: 'UserName', width: 100, sortable: true},
                { name: 'FirstName', width: 100, sortable: true },
                { name: 'MiddleName', width: 100, sortable: true },
                { name: 'LastName', width: 100, sortable: true },
                { name: 'EmailID', width: 150, sortable: true }
            ],
        rowNum: 10,
        rowList: [10, 20, 30],
        pager: '#UsersGridPager',
        sortname: 'UserID',
        viewrecords: true,
        sortorder: 'asc',
        autowidth: true,
        toppager: true,
        footerrow: true,


    });

    $("#UsersGrid").jqGrid('navGrid', '#UsersGridPager', { edit: false, add: false, del: false, search: false });


});

推荐答案

客户端很容易:
您可以通过搜索标记为可搜索等栏目:真正的,或有过滤器按钮,您的传呼机的一部分。你会发现这样既例子不胜枚举。我强烈reccomend你使用的Firefox喜欢使用Firebug或Chrome浏览器,所以你可以看到什么是被发送到你的服务器控件从客户端的问候过滤。

Client side it is easy:You can mark columns as searchable etc via the search: true, or have the filter button as part of your pager. You will find numerous examples of both on SO. I highly reccomend you use a browser like Firefox with Firebug or Chrome so you can see what is being sent to your server control from the client in regards to filtering.

服务器端你应该看看奥列格的回答在
ASP.NET MVC 2.0实施的jqGrid 在那里你会看到过滤器的辅助类,以及如何实现基于jqGrid的的控制数据的动态过滤搜索的。我也跟着用它来实现服务器端筛选将数据传递到我的网格。

Server side you should look at Oleg's answer at ASP.NET MVC 2.0 Implementation of searching in jqgrid where you will see the Filters helper class, and how you can implement dynamic filtering of your data based on the jqGrid's controls. I followed and used this to implement server side filtering to pass data to my grid.

好运气......这是一个有点设立的,但它会给你一个非常强大的客户端工具,当你做。

Good luck...it's a bit of setting up but it will give you a very powerful client side tool when you are done.

这篇关于如何添加的jqGrid随着FilterToolBar过滤Functinality启用了Asp.net的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-30 00:40