jQuery UI Widgets Forums Grid Showing XML blob in cell

This topic contains 2 replies, has 2 voices, and was last updated by  robf 3 weeks, 4 days ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • Showing XML blob in cell #134751

    robf
    Participant

    Hi,
    I have a grid that contains 4 columns. The 4th column holds an xml blob – e.g.

    <root>
        <row>
            <message>xxx</message>
            <message>yyy</message>
            <category>O</category>
             .
            .
            .
            .
            
         <row>
    <root>

    There are two things I am struggling to accomplish:
    1. Show the entire contents inside the cell without line breaks (it gets cropped) AND/OR
    2. Show entire contents with the xml indents and line breaks – so the cell height is rather large

    I have an xmlRenderer for the cell that simply does this:

    function xmlRenderer(row, column, value) 
    {
        // Escape special characters in XML string
        let escapedValue = value.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, "&quot;");
        return "<div>" + escapedValue + "</div>";
    }

    I get the xml inside the cell, but again it is cropped.

    I have a specific height set to the grid (and an auto-adjust method so that the bottom of the grid is always pinned to bottom of page).

    If I try to set the rowsheight, it seems to have no effect, even when I follow your example here: https://jsfiddle.net/jqwidgets/ayTST/

    I’ve also tried some “recalculateHeight” functionality in the bindingDone method, again with no luck.

    Have you possibly provided some other tips or suggestions for accomplishing this?

    Any ideas are greatly appreciated!
    Thanks.
    Rob

    Showing XML blob in cell #134793

    admin
    Keymaster

    Hi,

    The sample you’re posting, to see a different rows height, set it to something like 50 instead of 30 which is almost the same as the default.
    Showing entire XML in a cell may require a very large height of all cells in the Grid and you still may need a larger height depending on the xml content.
    I think it would be better if you show a button which shows the xml content in a popup after click.

    Best regards,
    Peter Stoev

    jQWidgets Team
    https://www.jqwidgets.com/

    Showing XML blob in cell #134816

    robf
    Participant

    Excellent point, Peter. I am taking your suggestion!
    Thank you.
    Rob

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.