免费jqGrid filterToolbar客户端搜索包含一些单词
如何配置免费jqGrid 4.8 filterToolbar来搜索字段中的所有单词 资料 123 234 143 搜索词 一四,返回第3行 四到三,返回第2行和第3行 一到三,返回第1行和第3行 四,返回第2行和第3行 jqGrid API 这是基于这一点,需要并请参阅上的演示免费jqGrid filterToolbar客户端搜索包含一些单词,jqgrid,free-jqgrid,Jqgrid,Free Jqgrid,如何配置免费jqGrid 4.8 filterToolbar来搜索字段中的所有单词 资料 123 234 143 搜索词 一四,返回第3行 四到三,返回第2行和第3行 一到三,返回第1行和第3行 四,返回第2行和第3行 jqGrid API 这是基于这一点,需要并请参阅上的演示 这使得搜索不区分大小写:var searchResults=fieldData.toLowerCase.indexOfthis.toLowerCase $("#list").jqGrid({ dataty
这使得搜索不区分大小写:var searchResults=fieldData.toLowerCase.indexOfthis.toLowerCase
$("#list").jqGrid({
datatype: "local",
colNames: ["Name"],
colModel: [{
name: "name",
index: "name"
}],
caption: "Viz Test",
pager: '#pager',
search: true,
multiselect: true,
data: myData
});
jQuery("#list").jqGrid('filterToolbar', {
searchOperators: true
});
colModel: [{
name: "name",
index: "name",
searchoptions: {
sopt: ["sIn", "bw", "cn", "lt", "le", "gt", "ge", "in", "ni"]
}
}],
customSortOperations: {
// the properties of customSortOperations defines new operations
// used in postData.filters.rules items as op peroperty
sIn: {
operand: "sIn", // will be displayed in searching Toolbar
text: "String In", // will be shown in Searching Dialog
// or operation menu in searching toolbar
filter: function (options) {
// called for filtering on the custom operation "sIn"
// It has the following properties:
// item - the item of data (exacly like in mydata array)
// cmName - the name of the field by which need be filtered
// searchValue - values in the input field of searching toolbar
var fieldData = options.item[options.cmName];
var words = options.searchValue.split(" ");
//loop thru each word in words array
$.each(words, function () {
//search for word in fielddata
var searchResults = fieldData.search(this)
//if not fouond
if (searchResults < 0) {
fieldData = "";
}
});
return fieldData;
}
}