1
我目前正在嘗試更新一行的值 - 取決於使用jQuery的另一個值的行。根據另一個值的行更新一行中的值
例如:
如果房分配=待定那麼按鈕編輯和取消下出現操作 如果房分配=待定那麼按鈕編輯和衰落出現下操作
如何我會這樣做嗎?
這裏是我已經包含了小提琴:http://jsfiddle.net/S9Gwy/
這是到目前爲止我的代碼:
$('.results_tbl').dataTable({
"bPaginate": true,
"bLengthChange": false,
"bFilter": true,
"bSort": true,
"bInfo": false,
"bAutoWidth": true
});
/*====================================
determining whether cancel or decline
button is going to appear depending on
room allocation status
=====================================*/
// find all the booking rows
var bookingRows = $('table tr.booking');
// stash a reference to the row
bookingRows.each(function() {
var row = $(this);
// if you can add a class of 'pending' to the status <td>, this becomes even cleaner and nicer...
// check the contents of the status column
if (row.find('td.status').text().toLowerCase() == 'pending') {
// add a class to the row so the CSS can do its thing...
row.addClass('pending');
}
});