We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Paging record count

Thread ID:





126253 Oct 4,2016 11:14 AM UTC Oct 5,2016 09:39 AM UTC JavaScript 1
Tags: ejGrid
Jon E
Asked On October 4, 2016 11:14 AM UTC

New to these controls so please excuse any idiocy.
I have some data coming in from an ajax call and it is has the total record count embedded in the data as a column.  This is all fine and the grid renders it no issues.  However I need to be able to tell the grid the number of records that are present so that the pager can be adjusted.  I have tried all sorts - adding count as a variable to an object along with the array of values.  Nothing works.  As an example taken from your own examples I have the following using which I want to pretend that there are 50 records total - 3 are downloaded...

    <div id='Grid'></div>
      var shipDetails = [
        {Name: 'Hanari Carnes', City: 'Brazil', test:true },
        {Name: 'Split Rail Beer & Ale', City: 'USA', test:true },
        {Name: 'Ricardo Adocicados', City: 'Brazil' }
      var test = {
        result: shipDetails, 
        count: 50 
      var dataManager = ej.DataManager(test);
      $(function () {
          dataSource: dataManager,
          allowPaging : true,
          pageSettings: {
            pageSize:2, showDefaults: false }

Venkatesh Ayothi Raman [Syncfusion]
Replied On October 5, 2016 09:39 AM UTC

Hi Jon, 

Thanks for contacting Syncfusion support. 

If we use pager template, then we will handle the pager operation programmatically. We can customize the pager template for showing the current page records of total records count. Please refer to the code example and sample, 
Code example: 
               dataSource: data, 
                allowPaging: true, 
                allowSorting: true, 
                actionComplete: 'complete', 
                pageSettings: { 
                    enableTemplates: true, 
                    template: “<div class='e-pagercontainer' id='showRecords'><span></span></div>", 
                    showDefaults: false 
                columns: [ 
                   .  .   . 
<Action Complete event> 
function complete(args) { 
                        . . . 
                     $("#showRecords").find('span').text('Showing'+' '+ this.model.pageSettings.pageSize+ ' ' +'of' +' '+ this.model.pageSettings.totalRecordsCount +' '+ "records"); 
               . . . 
<CSS for showing pager details in right most border of parger container > 
        . . . 
              background-color: white; 
. . . 
              .e-pagercontainer #showRecords{ 
Venkatesh Ayothiraman. 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon