When I click on a row - I add class info to it.
I want to pass values from selected row(it is always only one row) to modal form when I click on
I was trying to do like this(I check each row and in order to check data I show alert)
I was trying something like this too
What is the correct way to get data?
$("#roletable tbody").click(function(event) { $(oTable2.fnSettings().aoData).each(function() { $(this.nTr).removeClass('info'); }); $(event.target.parentNode).addClass('info'); });
I want to pass values from selected row(it is always only one row) to modal form when I click on
roleseditbutton.
I was trying to do like this(I check each row and in order to check data I show alert)
$("#rolesedit").click(function() { var arr = oTable1.fnGetNodes(); var item = null; for(var i = 0; i < arr.length; i++) { if ($(arr[i]).hasClass('info')){ item = oTable1.fnGetData(arr[i]); alert(item[0]); } } $('#ErolenameInput').val(item[0]); $('#ERoleID').val(item[1]); });But item[0] is always undefined.
I was trying something like this too
$(oTable1.fnSettings().aoData).each(function() { if ($(this.nTr).hasClass('info')) alert('has class' + oTable1.fnGetData(this.nTr)[0]); });but it undefined too.
What is the correct way to get data?