Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1390
Grid - no items text
posted

Hi

Is there any way that I can display some text like 'No items found' or something inside the grid when no items are rendered?

Thanks in advance.

Christoff

 

Parents
No Data
Reply
  • 24671
    Suggested Answer
    posted

    Hi Christoff,

    sure. This is one way:

     rendered: function (event, args) {

    if (args.owner.dataSource.dataView().length === 0) {

    if (args.owner.element.parent().find(".iggrid-empty").length === 0) {

    args.owner.element.parent().prepend("<div class='iggrid-empty'></div>");

    }

    args.owner.element.parent().find(".iggrid-empty").text("No rows present");

    }

     }

    If you want you can also bind to the rendered event outside of the grid initialization code (before you define it):

    $("#gridID").live("iggridrendered", function (sender, args) { ... } );

    hope it helps. Thanks,

    Angel

Children