问题
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