我必須找到除當前位置以外的表格中其他單元格的值。我正在做一些事情 -如何在迭代表格時獲取除當前行之外的行的單元格的值?
$('#poTable > .bodyTr').each(function() {
if ($(this).find(".variant").val() == productVariantId){
alert('Cannot add mutiple rows for same Variant');
value= false;
$(this).find(".variant").val('');
return value;
}
});
但這需要我也有行。 live
,因此將自己的價值與自身進行比較,從而產生false
。我必須排除當前行的值,同時檢查相同的值不與其他行。
你能證明代碼的情況下?如果它在一個事件處理程序中,這個''是單擊的單元格,你可以說'$('#poTable> .bodyTr')。not(this).each(...' – nnnnnn 2013-04-11 12:33:49