GXT Pagination Grid - Populate XML String as Grid Column Data
GXT Pagination Grid - Populate XML String as Grid Column Data
Hi,
I am using GXT 2.2.4. I have a Grid where I am populting the list of records. One of the Grid column contains XML String data. When I populate this column in the GRID, I am only getting the plain text without any XML contents.
For example, the expected XML String in the column is,
<?xml version="1.0" encoding="UTF-8"?><emailConfiguration><Name>TESTApplication</Name><AppName>TESTAPP</AppName><From>XX</From><To>YY</To><Subject>Email Notification</Subject></emailConfiguration>
But the actual data populated in the column is, TESTApplicationTESTAPPXXYYEmail Notification
Can you please suggest a way to populate and display the GRID column with XML content.
Assuming a relatively recent version of GWT, look at SafeHtmlUtils.fromString(String) or htmlEscape(String), depending on if you need a SafeHtml object for GXT 3 grid or a String for GXT 2. GXT 2.3.0 also added El.toSafeHTML(String) to properly escape a html string.
All of these are designed to properly escape content to be rendered in html without tags - this will work for xml as well as html.