This is a migrated thread and some comments may be shown as answers.

Detect no rows bound

0 Answers 17 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
David
Top achievements
Rank 1
David asked on 17 Jan 2011, 09:48 PM
What is considered the best practice for determining whether there are any rows bound?

Currently, I'm using the client-side OnDataBound event, and code similar to the following:

"No records to display."
gridDataBound: function (event)
{
    var rows = $('tbody tr:has(td)', this);
    if (rows.length == 0 || (rows.length == 1 && rows[0].innerText == "No records to display'))
        $('#GridSection').hide("slow");
}

There has got to be a better way!
Tags
Grid
Asked by
David
Top achievements
Rank 1
Share this question
or