Show " No data found." message

If there is no data to display in grid, can grid be made to display the message - “no records found” or “no data to display” message.

How to do it?

grid.attachEvent("onXLE", function(){ if (!grid.getRowsNum()) grid.addRow(grid.uid(), "no data"); })

Thanks for the DHTMLX code, that helped me. I did want the message to be displayed in the grid empty space, not in an actual blank grid row. This is easy enough by adding another DIV that get’s shown/hidden in the function you sent. I’m providing here for any interested…

GRID HTML: (we put our grids in a separate div)


No records matched your search criteria...

Then, using JQuery, our function is relatively straigth forward:

grid.attachEvent("onXLE", function(){ if (!grid.getRowsNum()) $("div#xId1_0").show(); else $("div#xId1_0").hide(); })

Obviously you can style your div in a more sophisticated manner, but this is the basic idea.