Search code examples
javascriptjquerybackbone.jsbackgrid

how to use "No Record Found" in backgrid.js


hi i want to print in my grid "No Record Found" nothing found or 0 rows in table. right now my grid showing result when it get data but when not it shows empty grid .so how can i print "no record found" when there is no record ?


Solution

  • In your BackGrid.Grid add the property emptyText which is a String.

    For example:

    var grid = new Backgrid.Grid({
      columns: columns,
      collection: myDataCollectoin,
      emptyText: "no data"
    });