This is a migrated thread and some comments may be shown as answers.

[Solved] Custom Display Text

1 Answer 148 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Adam Gritt
Top achievements
Rank 1
Adam Gritt asked on 15 Sep 2010, 06:51 PM
In our application we have a page that is displaying a grid and much more information.  In order to save space we have set up the CSS styles to reduce the amount of space that the rows take up and constrained the width of the grid.  We would also like to reduce the amount of space in the Pager portion of the grid by modifying the text that appears there from "Displaying items X - Y of Z" to just "Z Total items".  I have tried modifying the localization text client side instead of modifying the resource files as that would affect all of the grids but the result is the same.  If I change the "Displaying items {0} - {1} of {2}" to just be "{2} Total items" the javascript has an error on the telerik.common.js: formatString method in that when it executes the following lines:
                if (formatter) {
                    var match = reg.exec(s);
                    argument = formatter(argument, match[2]);
                }
It throws an exception in that it is using the match without first checking to see if it found a match.  I have tried searching for some other method of modifying this specific text in the pager without luck.  I have considered binding to the databound event on the client side and then modifying it after the data is bound but that seems a bit kludgy.  Does anyone have any input on solving this other than modifying the javascript myself to check if a match was found?  Or can this be fixed in the official release as all it needs is a simple "if (match)" check before calling the formatter in order to support modified display strings?

1 Answer, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 16 Sep 2010, 08:36 AM
Hi Adam Gritt,

We have fixed this already (added the if(match)) check. The fix will go official in the first service pack expected at the end of this month. You can check for an internal build however which should be available earlier.

Regards,
Atanas Korchev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Grid
Asked by
Adam Gritt
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Share this question
or