【发布时间】:2011-09-21 16:24:17
【问题描述】:
我有一个存储一些数据的表。此数据从 code.php 以 JSON 结构的数组返回。
$("#errtable").tablesorter();
$.getJSON("./include/code.php", {key:$('#key').val()}, function(data) {
// append the "ajax'd" data to the table body
$.each(data, function(key) {
$("#errtable > tbody").append("<tr><td>"+data[key].errorcode+"</td><td>"+data[key].errordescription+"</td></tr>");
});
// let the plugin know that we made a update
$("#errtable").trigger("update");
// set sorting column and direction, this will sort on the first and third column
var sorting = [[2,1],[0,0]];
// sort on the first column
$("#errtable").trigger("sorton",[sorting]);
});
问题是Firebug显示错误:
o 未定义 [Break On This Error] o.count = s[1];
指:
function updateHeaderSortCount(table, sortList) {
var c = table.config,
l = sortList.length;
for (var i = 0; i < l; i++) {
var s = sortList[i],
o = c.headerList[s[0]];
o.count = s[1];
o.count++;
}
}
有人可以帮我解决这个问题吗?
谢谢。
【问题讨论】:
标签: php javascript jquery jquery-plugins