Displaying different "pagerInfo" text for different grids

Hello,

I would like to have two different "pagerInfo" texts, each for one of two Grid controls that appear in my application. For example, to display "Number of contracts" for grid that shows contracts and "Number of devices" for another grid that shows devices. I have defined one "pagerInfo" text by setting the "locale" member of ejPager object, but I do not see a way how to create two of them for same language/culture. Is it possible to do?

Thanks in advance.

3 Replies

SS Seeni Sakthi Kumar Seeni Raj Syncfusion Team August 10, 2018 09:13 AM UTC

Hi Petra,  

Thanks for contacting Syncfusion Support.  

We can use the create event of the pager to change the localized text for each individual Grid as shown in the following code example. You could see the create event of the Pager has been bound in the load event of the Grid where you can assign the required pager’s pagerInfo.  

<ej-grid id="OrdersGrid" load="onOrderLoad" allow-paging="true"> 
      .. .  
              . . 
</ej-grid> 
 
<ej-grid id="EmployeesGrid" load="onEmployeeLoad" allow-paging="true"> 
      .. .  
              . . 
</ej-grid> 
 
<script type="text/javascript"> 
    function onOrderLoad(args) { 
        this.model.pageSettings.create = function (args) { 
            this.localizedLabels.pagerInfo = "{0} of {1} pages ({2} Orders)" 
        } 
    } 
    function onEmployeeLoad(args) { 
        this.model.pageSettings.create = function (args) { 
            this.localizedLabels.pagerInfo = "{0} of {1} pages ({2} Employees)" 
        } 
    } 
</script> 

Output

 


Refer to the Help Document for available Localization Properties, https://help.syncfusion.com/aspnet-core/pager/localization

Regards,  
Seeni Sakthi Kumar S. 



PV Petra V August 10, 2018 10:57 AM UTC

Thank you, this solved my problem :)


SS Seeni Sakthi Kumar Seeni Raj Syncfusion Team August 10, 2018 11:06 AM UTC

Hi Petra,  
 
Thanks for the update.  
 
We are happy to hear that your requirement has been achieved. Please update us, if you require further assistance on this.  
 
Regards,  
Seeni Sakthi Kumar S. 


Loader.
Up arrow icon