PDA

View Full Version : Groupingview issue with special characters



mhaynes121
9 Feb 2012, 8:52 AM
Hopefully this is a simple question and I'm just making it harder than it should be but...

I have a form that contains a grid which contains a grouping view. The form is a test creation form which allows you to enter test questions and then answers for that question. The view is grouped on the question and everything is great. With the way I have it setup I can add, edit, delete questions and answers with no issues and the grouping expansion and collapsing appear to all be in working order; EXCEPT, if we put in any of these characters (everything between the -'s) - & " < > - into the question (the group header if you will) AND ALSO add one of those characters to an answer for that question the grouping expansion / collapsing no longer works. At this point the 'child' rows (answers) are hidden as the question is collapsed but I can not expand it again. If I remove the special character from the question it works.

Works when:
The question and its answers do not contain one of those characters or if only one of them does (either question or answer)
Can have special characters in each of the answers as long as there is not one in the question.

Fails when:
The question and answer both have a special character even if the character can is different.

And just additional info: we edit the grid by using some edit/save/delete hyperlinks that are added to the grid during display. When you click the edit button the column that contains the text for that item (question or answer) is changed to a textarea and when you save it is changed back to a standard div.

mitchellsimoens
9 Feb 2012, 9:20 AM
You should try and replace those characters with their HTML code

mhaynes121
9 Feb 2012, 9:50 AM
I tried using .escape() to escape those characters but the issue still occurs. Is there another method that I could try?

Also... if it were an encoding problem wouldn't that happen if one of those characters were anywhere and not just when you have it in both at the same time?

***** edit *****
Been doing some looking at what the actual code looks like on the client and I think I may have found the issue. Apparently EXTJS uses the value in the grouped field as the id of that item. So if I put in this as the question text: "~!@#$%^&*()_+|}{":?><`\][';/.," the ID for that DIV becomes: "ext-gen218-gp-Question-~!@#$%^&amp;*()_+|}{&quot;:?><`\][';/.,-hd". I'm wondering if this is the issue since I believe ID's can't contain several of those characters.

mhaynes121
9 Feb 2012, 2:08 PM
Well I found a way to make my stuff work. Instead of using the question as the grouping field (which is why the ID ends up with special chars) I changed it to group off of the ID for that question. This works and allows me to do what I want since my ID is now a simple int.