我試圖從flexigrid獲取單元格的文本值。 但是我不斷收到該錯誤。未捕獲的錯誤:語法錯誤,無法識別的表達式:#
這是我的功能,用於檢索特定單元格的文本(Flexigrid不具有「attr」而是具有「abbr」)。
function getSelectedCopyDates() {
var arr = new Array();
debugger;
//for every row that has a checked checkbox
$("tr").has(".noteCheckBox:checked").each(function(i) {
if ($(this.id) !== "checkAllNotes") {
//push the value of column(FName, LName) into the array
arr.push($("#" + this.id + "> td[abbr='EventDate'] > div").text());
}
});
return arr;
}
我只在點擊「checkAllNotes」(主複選框)時出現該錯誤。如果我手動檢查複選框,那麼一切工作正常。
這裏是我的flexigrid佈局:
$('#viewNotesGrid').flexigrid({
url: url,
dataType: 'json',
method: 'get',
colModel: [{
display: '<input type="checkbox" class="noteCheckBox" id="checkAllNotes" />',
name: 'checkBox',
width: 20,
sortable: false,
align: 'center',
process: showDescription
}, {
display: 'Date',
name: 'EventDate',
width: 80,
sortable: true,
align: 'center',
process: showDescription
},
@TimMedora都能跟得上。 –