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

[Solved] $.telerik.formatString issue

3 Answers 78 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Donna Stewart
Top achievements
Rank 1
Donna Stewart asked on 14 Apr 2011, 04:02 AM
I am using $.telerik.formatString in the following manner:

urlFormat = '<%= HttpUtility.UrlDecode(Url.Action("EditReportGroup", "Report", New With { .id = "{0}", .groupName = "{1}" } )) %>';
specificUrl = $.telerik.formatString(urlFormat, selectedValue, selectedText);
alert(selectedValue + " " + selectedText);
$("#reportindexright").load(specificUrl);

It appears that if the selectedText substituted for .groupName has a space in it, groupName is being sent with just the characters before the first space.  The rest of the string is cut off.  I know that selectedText is correct as I see the full string in the alert.  I am thinking maybe it is in the way I am using $.telerik.formatString, but I couldn't find any documentation on how to use it, just different examples in the forum.

Your help is very much appreciated.

Thank you,
Donna

3 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 14 Apr 2011, 08:29 AM
Hello Donna Stewart,

 I don't understand what the problem is. Could you please specify what the format string is (when output on the clientside' and what the values for selectedValue and selectedText which break are?

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
0
Donna Stewart
Top achievements
Rank 1
answered on 14 Apr 2011, 03:45 PM
I am using it to format the url used in the jquery .load (to load the div with the partial view returned by the action in the url).  It follows an example I found on your site here.  I need to send the 2 parameters back to the action on the url.  The selectedValue is a number, and an example is 120 (it is an id).  The selectedText is text, and an example is "Another New Report Group Modified".  For this example, I am getting just "Another" as the selectedText when it is passed on the url to the action, but the alert which prints out the selectedText shows "Another New Report Group Modified".

Thank you for your help,
Donna
0
Donna Stewart
Top achievements
Rank 1
answered on 14 Apr 2011, 05:23 PM
I fixed it by using the javascript escape on the selectedText.

urlFormat = '<%= HttpUtility.UrlDecode(Url.Action("EditReportGroup", "Report", New With { .id = "{0}", .groupName = "{1:s}" } )) %>';
specificUrl = $.telerik.formatString(urlFormat, selectedValue, escape(selectedText));
alert(selectedValue + " " + selectedText);
$("#reportindexright").load(specificUrl);

Thanks!
Donna
Tags
General Discussions
Asked by
Donna Stewart
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Donna Stewart
Top achievements
Rank 1
Share this question
or