How to show total records in JQGRID footer

Posted: January 12, 2016 in JavaScript, JQuery

Use the recordtext property wit value like below.

recordtext:'{0} – {1} of {2} records’

For example,

var grid = $(“#list1″)
grid.jqGrid({
url:”RelatedPublication.cfc, //CFC that will return the users
datatype: ‘json’, //We specify that the datatype we will be using will be JSON
colNames:[‘UPID’,’PUBNUMBER’,’VOL”], //Column Names

colModel :[
{name:’UPID’,index:’UPID’, width:50,resizable:false,sortable:true,sorttype:”int”,resizable:false,editrules:{readonly:true}},
{name:’PUBNUMBER’,index:’PUBNUMBER’, width:130,resizable:false, sorttype:”text”,editable:true,edittype:”text”,editoptions:{size:30,maxlength:50},editrules:{required:true}},
{name:’VOL’,index:’VOL’, width:150,resizable:false, align:”left”,sorttype:”text”,editable:true,edittype:”text”,editoptions:{size:30,maxlength:50},editrules:{required:true}},
],

pager: $(‘#pager1’), //The div we have specified, tells jqGrid where to put the pager
rowNum:25, //Number of records we want to show per page
rowList:[25,50,100,500,1000,5000,10000,15000,20000,50000], //Row List, to allow user to select how many rows they want to see per page
sortorder: “asc”, //Default sort order
sortname: “ID”, //Default sort column
viewrecords: true, //Shows the nice message on the pager
imgpath: ‘/themes/jqgrid/css/images’, //Image path for prev/next etc images
caption: ‘Related Publications’, //Grid Name
mtype:’GET’,
recordtext:'{0} – {1} of {2} records’,
scrollerbar:true

 

Leave a comment