jQuery UI Widgets Forums Grid multiple line data in grid

This topic contains 4 replies, has 2 voices, and was last updated by  jkapasi 9 years, 9 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
  • multiple line data in grid #70288

    jkapasi
    Participant

    Hello,

    I have an issue in loading of the grid.

    I am having data of multiple line which needs to be shown in the grid. But on loading of the grid it gives me following error:

    Syntax Error: Invalid character

    I removed multiple lines and tested and the grid loads properly. Hence the issue I am facing is because of multiple lines.

    Please provide a solution to handle multiple lines of data.

    Thanks.

    Regards
    Jash

    multiple line data in grid #70295

    Dimitar
    Participant

    Hello Jash,

    Please share what format is your multi-line data in. A JSFiddle example reproducing the issue would also help us better understand why it occurs. Please also make sure you are using the latest version of jQWidgets (3.7.1).

    Best Regards,
    Dimitar

    jQWidgets team
    http://www.jqwidgets.com/

    multiple line data in grid #70299

    jkapasi
    Participant

    I am getting the data from the database in the form of string.

    eg.
    Hello
    How
    Are You

    I have tried following code to handle new line character:

    rsvalue = rsvalue.replaceAll("(\\r|\\n|\\r\\n)+", "\\\\n");

    By using the above code my error of loading grid is solved. But the data in my grid looks like:

    Hello \n How \n Are You

    What I want in the grid should be same as the data.

    Is there any workaround to handle new line characters?

    Regards,
    Jash

    multiple line data in grid #70343

    Dimitar
    Participant

    Hello Jash,

    You can convert the \n characters to <br /> tags. Such replacements can also be done in the cellsrenderer function.

    Best Regards,
    Dimitar

    jQWidgets team
    http://www.jqwidgets.com/

    multiple line data in grid #70382

    jkapasi
    Participant

    Thank You.

    It worked for me. I am getting the desired output.

    Regards,
    Jash

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

You must be logged in to reply to this topic.