datatable with details does not have icons added after paging to new page
datatable with details does not have icons added after paging to new page
DavidBoomer
Posts: 21Questions: 0Answers: 0
this is in a .Net environment, and jQuery datatable code is being applied to a gridview ( using this fix for the thead and tbody attributes
http://www.codeproject.com/Articles/267001/GridviewFix-helper-plugin ). when i navigate to a new page, the icons for the details view are not being added until i click a link in the table, which causes an async postback. only thought i've had is to trap for the click on the navigation buttons, then run the datatable code again, but i'm unsure how to do that. fwiw, the only way i've gotten the jQuery code to bind at all to the second page is to put the document.ready, etc... code inside the asp builtin pageLoad function. this function, which runs with all full and async postbacks in asp, is not being triggered with the click of the jQuery pagination contols. maybe that's the simplest question i can ask: how can i attach an async postback event to the click of the navigation controls?
david
http://www.codeproject.com/Articles/267001/GridviewFix-helper-plugin ). when i navigate to a new page, the icons for the details view are not being added until i click a link in the table, which causes an async postback. only thought i've had is to trap for the click on the navigation buttons, then run the datatable code again, but i'm unsure how to do that. fwiw, the only way i've gotten the jQuery code to bind at all to the second page is to put the document.ready, etc... code inside the asp builtin pageLoad function. this function, which runs with all full and async postbacks in asp, is not being triggered with the click of the jQuery pagination contols. maybe that's the simplest question i can ask: how can i attach an async postback event to the click of the navigation controls?
david
This discussion has been closed.
Replies
Can you link to your page please?
Allan
Allan
I think I need to add the gridviewfix right after document.ready, as a separate step:
[code]
$(document).ready(function() {
var oTableTemp = $("#GridViewExample").GridviewFix(); //here
var nCloneTd = document.createElement( 'td' );
nCloneTd.innerHTML = '';
nCloneTd.className = "center";
$('#example thead tr').each( function () {
this.insertBefore( nCloneTh, this.childNodes[0] );
} );
$('#example tbody tr').each( function () {
this.insertBefore( nCloneTd.cloneNode( true ), this.childNodes[0] );
} );
/*
* Initialse DataTables, with no sorting on the 'details' column
*/
var oTable = oTableTemp.dataTable( { // syntax ??
"aoColumnDefs": [
{ "bSortable": false, "aTargets": [ 0 ] }
],
"aaSorting": [[1, 'asc']]
});
// etc... from example at
// http://www.datatables.net/release-datatables/examples/api/row_details.html
}
[/code]
Right now the gridviewfix and the datatable initialization are chained together.
On iPad now. Will check syntax and code execution tomorrow at work.
Thanks, Allan.
Thanks, Allan.
Allan