"oLanguage" : {
"sLengthMenu" : 'Display <span class = "ef_pagination_length" onclick = "oTable.fnShowLess()">Less</span> <span class = "ef_pagination_length" onclick = "oTable.fnShowMore()">More</span> records'
}
b) Implement the following methods:
$.fn.dataTableExt.oApi.fnShowMore = function( oSettings ) {
var idx = $.inArray(oTable.fnPagingInfo().iLength, oTable.fnSettings().aLengthMenu);
if (idx != -1 && idx < oTable.fnSettings().aLengthMenu.length-1) {
oTable.fnLengthChange(oTable.fnSettings().aLengthMenu[idx+1]);
}
}
$.fn.dataTableExt.oApi.fnShowLess = function( oSettings ) {
var idx = $.inArray(oTable.fnPagingInfo().iLength, oTable.fnSettings().aLengthMenu);
if (idx != -1 && idx != 0) {
oTable.fnLengthChange(oTable.fnSettings().aLengthMenu[idx-1]);
}
}
It looks like you're new here. If you want to get involved, click one of these buttons!
Get useful and friendly help straight from the source.