getattribute on selectedrow
getattribute on selectedrow
buraksensoz
Posts: 1Questions: 1Answers: 0
hello
i've a problem. i try to get special attribute value.
my code like this
[code]
$(document).ready(function() {
$('#bankatable').DataTable({
"scrollY" : "150px",
"scrollCollapse" : false,
"paging" : false,
"searching" : false,
"info" : false
});
var table = $('#bankatable').DataTable();
$('#bankatable tbody').on('mouseenter', 'td', function() {
var colIdx = table.cell(this).index().row;
$(table.cells().nodes()).removeClass('highlight');
$(table.row(colIdx).nodes()).addClass('highlight');
});
$('#bankatable tbody tr:eq(0)').addClass('selected');
$('#bankatable tbody').on('click', 'tr', function() {
if (!$(this).hasClass('selected')) {
table.$('tr.selected').removeClass('selected');
$(this).addClass('selected');
}
selectedbankid=this.getAttribute("bankid");
});
});
[/code]
i need to use "selectedbankid=this.getAttribute("bankid");" from other function but i can't do this
Thanks for answers
This discussion has been closed.
Answers
you are making it harder than it is. You should be using the Select extention, then you can do something as simple as
Why are you not using the Select extension?
you are making it harder than it is. You should be using the Select extention, then you can do something as simple as
Why are you not using the Select extension?