如何为新的 free-jqgrid 保留传统的过滤器格式?
How can I keep tradicional filter format for new free-jqgrid?
我正在尝试从 jqGrid v4.7 升级到最新的 jqGrid 4.12.1 - free jqGrid fork。
我面临的问题是,使用服务器端搜索,过滤器参数不会使用前者构建
{"groupOp":"AND","rules":[{"field":"Name","op":"cn","data":"bob"}]}
style,我刚得到一个额外的 Name
参数,值为 bob
(_search
是 true
)。
我在这里错过了什么?
提前致谢
我想您使用的 filterToolbar
没有 stringResult: true
参数,并且问题与将 jqGrid 4.7 升级到免费的 jqGrid 4.12.1 无关。请参阅 filterToolbar
的 the documentation 的第一部分,其中描述:
When the search is activated, an array of type name:value
is posted
to the server. Note that this array is added to the postData
parameter. We post only fields that have an entered value. When we
clear the the search form, the values are deleted from the postData
array. When posting to the server, we try to pass, not the name, but
the index
set in colModel
. When the index
is not found we use
the name
. Additionally, we add a _search=true
to the posted data.
When the stringResult
option is set to true the data posted to the
server is a string and the structure of the posted data is the same as
in Advanced Search.
我正在尝试从 jqGrid v4.7 升级到最新的 jqGrid 4.12.1 - free jqGrid fork。
我面临的问题是,使用服务器端搜索,过滤器参数不会使用前者构建
{"groupOp":"AND","rules":[{"field":"Name","op":"cn","data":"bob"}]}
style,我刚得到一个额外的 Name
参数,值为 bob
(_search
是 true
)。
我在这里错过了什么?
提前致谢
我想您使用的 filterToolbar
没有 stringResult: true
参数,并且问题与将 jqGrid 4.7 升级到免费的 jqGrid 4.12.1 无关。请参阅 filterToolbar
的 the documentation 的第一部分,其中描述:
When the search is activated, an array of type
name:value
is posted to the server. Note that this array is added to thepostData
parameter. We post only fields that have an entered value. When we clear the the search form, the values are deleted from thepostData
array. When posting to the server, we try to pass, not the name, but theindex
set incolModel
. When theindex
is not found we use thename
. Additionally, we add a_search=true
to the posted data.When the
stringResult
option is set to true the data posted to the server is a string and the structure of the posted data is the same as in Advanced Search.