-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Click in a row event #43
Comments
The
$(".datagird").on("click", "tr", function() { });
I cannot write actual code to show you how to use these right now but if you have issue with the above directions, feel free to ask for clarification. |
Hello, the first option was great, but the question remains. How can I use the "afterRefresh" and place a code that I need. |
So the first option did not solve your issue?
This should work (when constructing the datatable: $(".datagird").datatable({
/* Your other options... */
afterRefresh: function() {
// Or $(this).find("tr").click
$('.datagird tr').click(function(){
var code = "";
code = $(this).find("td").eq(0).find("input").val();
$("hdfCode").val(code);
$(".selectRow").toggleClass('selectRow');
$(this).find("td").toggleClass('selectRow');
});
}
}); |
Hi, again me: D
I have the following case and I hope you can help me.
I am adding the following code by jquery:
Everything works fine, the problem occurs when I make a filter or change of page, then the click event of the row stops working, I imagine it is due to the restructuring of the table.
Any idea to keep the click event in the row working, even after making a filter or changing the page.
The text was updated successfully, but these errors were encountered: