【发布时间】:2011-12-28 16:31:30
【问题描述】:
我刚刚在www.werelate.org/wiki/Special:ListPages/Jdfoote1 完成了我的第一个 SlickGrid 实现。
不幸的是,我收到报告说过滤器在 IE 上不起作用。我想知道 IE 上的 SlickGrid 过滤是否存在已知问题。这是有问题的代码:
// Define search filter (currently searches name, birth place, and death place)
function myFilter(item) {
var searchWords = getWords(searchString);
var searchFields = ["name","birthPlace","deathPlace", "birthDate", "deathDate"];
if (searchWords){
// Go through each of the words in the search string
for (j in searchWords){
var itemFound = false;
searchWord = searchWords[j].toUpperCase();
// Make sure that the word is in at least one of the search fields.
for (i in searchFields){
if (item[searchFields[i]].toUpperCase().indexOf(searchWord) != -1){
itemFound = true;
}
}
if (itemFound === false){
return false;
}
}
}
return true;
}
// Get all of the words in a search string
function getWords(wordString){
pattern = /[^, ]+/g;
wordArray = wordString.match(pattern);
return wordArray;
}
非常感谢!
【问题讨论】:
-
在 Chrome 中似乎根本不起作用。没有 JS 错误被报告。
-
抱歉,这只是代码的一小部分。
标签: javascript slickgrid