jQuery UI Widgets › Forums › Grid › jqxGrid emptyDataString needs to add html
Tagged: emptydatastring, grid, html, jqxgrid, label, localization, message, No data to display, tag
This topic contains 5 replies, has 3 voices, and was last updated by Dimitar 8 years, 12 months ago.
-
Author
-
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,
AlpeshHello,
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>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,
DimitarjQWidgets team
http://www.jqwidgets.com/Thanks you very much Dimitar.
Regards,
AlpeshDid you declare it like this:
$(“#jqxgrid”).jqxGrid(
{
localization:{
emptydatastring: $(“.jqx-grid-empty-cell span”).html(“Custom no data to display message.“),
}
});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,
DimitarjQWidgets team
http://www.jqwidgets.com/ -
AuthorPosts
You must be logged in to reply to this topic.