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

Change the "items" term in the grid.

Thread ID:

Created:

Updated:

Platform:

Replies:

107287 Feb 22,2013 06:23 PM UTC Feb 27,2013 12:55 PM UTC Mobile MVC(Classic) 5
loading
Tags: Grid
Mijail O Tornes
Asked On February 22, 2013 06:23 PM UTC

Hi,

We will like to know if its possible to change the word "items" in the grid's Caption bar that follows the number of items the grid contains.
[...]
            .Datasource(Employees.List).Caption("Employees")
[...]
So instead of the caption being:   "Employees 24 items" we could display: "Employees 24 records"

In case this is not achievable, how do we remove this header?

Thanks,

Mijail

Thivya [Syncfusion]
Replied On February 25, 2013 05:47 AM UTC

Hi Mijail,

Currently, we don’t have support for customizing the caption in the Grid header. If you want to do as per your requirement then you should use jQuery “pagebeforeshow” event to update the full caption as an workaround. Please refer the below code snippets.

$("div[data-role='page']").bind("pagebeforeshow", function () {

   var ele = $sf.getCurrentPage().find("#grid .sf-caption-row");

   ele.html(ele.html().replace("Items", "Records"));

});

Otherwise, you can make the “ShowCaption” property with false which we have provided to remove the header. Please do as in following code snippets.

[...]

            .Datasource(Employees.List).Caption("Employees").ShowCaption(false)

[...]

Please try this and get back to us if this helps out.

Regards,
Thivya.


Mijail O Tornes
Replied On February 25, 2013 04:36 PM UTC

Hi Thivya,

Using the pagebeforeshow event works at page(view) level only. 
If there was a way to bind this replace script to the grid's creation/update triggers or functions?
Thanks,
Mijail 
  

Thivya [Syncfusion]
Replied On February 26, 2013 10:24 AM UTC

Hi Mijail,

We have provided Load event for the Grid control so that you can use the script with “OnLoad” event. Please refer the following code snippets.

function load() {
        var ele = $sf.getCurrentPage().find("#grid .sf-caption-row");
        ele.html(ele.html().replace("Items", "Records"));
}

And handle the event in view page as follows..

[...]
      
.Events(e => e.OnLoad("load"))
[...]

Please let us know if you have any queries.

Regards,
Thivya.


Mijail O Tornes
Replied On February 26, 2013 10:37 PM UTC

Hi,

Using the onLoad() function works fine but if the page is reloaded: (F5 by keyboard).
The grid puts back the "items" label.
Any suggestions for this issue?

Thivya [Syncfusion]
Replied On February 27, 2013 12:55 PM UTC

Hi Mijail,

We are not able to reproduce the issue you mentioned that Grid push back the "items" label when reloading the page. For your reference we have attached sample hereby please go through the sample and get back to us if this helps out.
             

Regards,
Thivya.


Grid_f8a720e8.zip

CONFIRMATION

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.

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

;