PDA

View Full Version : ExtJS 3.4 Remove all symbols after '&' in window title



johniman
13 Feb 2013, 6:28 AM
Hi!
I have edit window, that contains the name of editable item in the title. But when item name contains '&' - everything after that character - cut. This is my code for window title:



title:msg.edit_item + " - " + me.initialConfig.itemName,

willigogs
13 Feb 2013, 8:31 AM
Replace all instances of "&" with "&amp"; prior to adding it to your title :)

johniman
13 Feb 2013, 11:05 PM
Yes, I also did :)

willigogs
14 Feb 2013, 7:28 AM
So are you still having issues with this?

If so, could you provide a more detailed example of the issue you are running into, including example variables?

In my testing I've had no such issues when attempting something like the following:



var v1 = 'Hello';
var v2 = 'Goodbye & Goodnight';

var panel = {
title: v1 + ' - ' + v2
};

johniman
14 Feb 2013, 11:19 PM
I solve problem like you wrote first: "replace all instances of "&" with "&amp"; prior to adding it to your title". If you insert "&" like this: Goodbye & Goodnight - it works, cause you have spaces around "&".