jQuery UI Widgets Forums Grid jqxGrid emptyDataString needs to add html

This topic contains 5 replies, has 3 voices, and was last updated by  Dimitar 7 years, 8 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
  • jqxGrid emptyDataString needs to add html #64307

    alpesh
    Participant

    Hello,

    We need to help emptyDataString tring with append some html tag and style.
    We are using below like code in localizationobj.
    localizationobj.emptyDataString = '<div>No Results Found <br/><br/><br/><br/> <a class="add_btn_click" data-value="Add" href="javascript:void(0);" ><br/>Add</a></div>';

    Could you please help us ?

    Thanks,
    Alpesh

    jqxGrid emptyDataString needs to add html #64311

    alpesh
    Participant

    Hello,

    Same thing like above is working fine on jqxDataTable .but on jqxGrid not accepting html and showing text with html tag in emptyDataString localizationObj.

    Example jqxGrid showing emptyDataString like <br/><br/>No Results Found <br/><br/><br/><br/> <a class="job_applicatn_history_new_click" data-value="reviews_listTable" href="javascript:void(0);" ><img src="../images/plus.png"/><br/>Add</a>

    jqxGrid emptyDataString needs to add html #64314

    Dimitar
    Participant

    Hello Alpesh,

    Unfortunately, the emptyDataString message does not support HTML content, only plain text. As a workaround, you can make a jQuery selection of the label and set your content as follows:

    $(".jqx-grid-empty-cell span").html("<em>Custom no data to display message.</em>");

    Note, however, that this will work only until you scroll/edit/refresh the grid and after that you will have to call the same code again to maintain the customized appearance of the label.

    Best Regards,
    Dimitar

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

    jqxGrid emptyDataString needs to add html #64315

    alpesh
    Participant

    Thanks you very much Dimitar.

    Regards,
    Alpesh


    dan123
    Participant

    Did you declare it like this:
    $(“#jqxgrid”).jqxGrid(
    {
    localization:{
    emptydatastring: $(“.jqx-grid-empty-cell span”).html(“Custom no data to display message.“),
    }
    });


    Dimitar
    Participant

    Hello dan123,

    This is not the correct approach. The code has to be called after the grid has been initialized, e.g. in its ready callback function: http://jsfiddle.net/Dimitar_jQWidgets/zu018st1/.

    Best Regards,
    Dimitar

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

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

You must be logged in to reply to this topic.