【发布时间】:2014-02-03 08:31:54
【问题描述】:
我想在使用过滤器工具栏时突出显示搜索结果。
我尝试使用Oleg 和Abhishek Simon 提供的here 解决方案, 但它不适用于 JqSuite for PHP。
grid.php 代码 sn-p
$highlighting = <<<HIGHLIGHTING
function () {
var filters, i, l, rules, rule, iCol, $this = $(this);
if (this.p.search === true) {
filters = $.parseJSON(this.p.postData.filters);
if (filters !== null && typeof filters.rules !== 'undefined' &&
filters.rules.length > 0) {
rules = filters.rules;
l = rules.length;
for (i = 0; i < l; i++) {
rule = rules[i];
iCol = getColumnIndexByName($this, rule.field);
if (iCol >=0) {
$('>tbody>tr.jqgrow>td:nth-child(' + (iCol + 1) +
')', this).highlight(rule.data);
}
}
}
}
}
HIGHLIGHTING;
$grid->setGridEvent('loadComplete',$highlighting);
我收到此错误:
注意:未定义变量:this
你能理解我做错了什么吗?
【问题讨论】:
标签: javascript php jqgrid jqgrid-php