Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82143

How to display the records/entries of datatable based on setting of iDisplayStart value

$
0
0
i have written a sample code like as below..
My intention is that based on the value(page number) entered in the textbox and i want to set the iDisplayStart value. Could any one do please assist me on this..? When i use below code am getting an error message saying "pass no arguments or see the docs for bRetrieve and bDestroy".

$(document).ready(function() {
    /* Build the DataTable with third column using our custom sort functions */
    $('#exampleTable').dataTable( {
		"sDom":'<"top"l<"#table_page1">p>t<"bottom"i<"#table_page1">p>',
		 "aLengthMenu": [[5, 10, 25, 50, -1], [5, 10, 25, 50, "All"]],
		 "bStateSave": true,
		 "iDisplayStart": 0,
		 "iDisplayLength": 10,
		 "sPaginationType": "full_numbers",
		 "bRetrive": true
    } );
	
	
} );

$(function(){
 $('#pageMover').keypress(function(event) {
        if (event.keyCode == '13') {
            alert('Entered');
			moveToPageFunc();
        }
    });
	
	function moveToPageFunc(){
	var moveToPage=$("#pageMover").val();
	var myTable = $('#exampleTable').dataTable();

	var oSetting = myTable.fnSettings();
	
	
	if(moveToPage!= null || moveToPage!= '' || moveToPage!= undefined){
			alert('hi'+moveToPage);
			$('#exampleTable').dataTable( {"iDisplayLength": 20});
	}else{	
		alert('hi');
	}
	$(oSetting.oInstance).trigger('page', oSetting);
}
	
}); 

Thanks.

Viewing all articles
Browse latest Browse all 82143

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>