how to create sql WHERE clause from jqgrid multipleGroup filter condition in ASP .NET MVC2

[亡魂溺海] 提交于 2020-01-05 09:09:36

问题


jqGrid multiple group search is used which produces grouped filters object. ASP .NET MVC2 is used in server side to create where clause string which is passed to PostgreSql.

Oleg ASP.NET MVC jqGrid sample sql where clause builder builds invalid where clause for this condition. It works only without gruping.

Whre to find sample C# code which generates corrent where clause if multipleGroup: true is used ?

$.extend($.jgrid.search, {
    savekey: [true, 13],
    multipleSearch: true,
    multipleGroup: true,
    recreateForm: true,
    overlay: 0,
    closeOnEscape: true,
    closeAfterSearch: true
 });

Edit

Here is link to WHERE clause builder ASP.NET MVC 2.0 Implementation of searching in jqgrid


回答1:


Please take a look at JqGridRequestModelBinder class which is ASP.NET MVC model binder for jqGrid request, it should give you an idea how to deserialize the multipleSearch/multipleGroup filters. You can find here all the other necessary classes. This is all part of Lib.Web.Mvc project. You can find samples on how to use this library here (go the zip file or get the latest version from Subversion).



来源:https://stackoverflow.com/questions/9590307/how-to-create-sql-where-clause-from-jqgrid-multiplegroup-filter-condition-in-asp

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