Это довольно просто с синтаксисом обратного вызова attr
:
$("#product1 :checkbox").click(function(){
$(this)
.closest('tr') // find the parent row
.find(":input[type='text']") // find text elements in that row
.attr('disabled',function(idx, oldAttr) {
return !oldAttr; // invert disabled value
})
.toggleClass('disabled') // enable them
.end() // go back to the row
.siblings() // get its siblings
.find(":input[type='text']") // find text elements in those rows
.attr('disabled',function(idx, oldAttr) {
return !oldAttr; // invert disabled value
})
.removeClass('disabled'); // disable them
});