Stop Display of "No data available in table"
Stop Display of "No data available in table"
Initially my table has no data and I get "No data available in table" which is the expected functionality.
I'd like to have no text or row created as I will be populating the table via Ajax depending on user action.
Is there a setting to stop the display of this row in the table? I can't seem to find one.
TIA
Richard
I'd like to have no text or row created as I will be populating the table via Ajax depending on user action.
Is there a setting to stop the display of this row in the table? I can't seem to find one.
TIA
Richard
This discussion has been closed.
Replies
Allan
I've also tried sEmptyTable and sZeroRecords with them set to an empty string but they still return a default string in the row I don't want to see.
Allan
Allan
This is for an intranet site so no accessible page available but here are some code snippets...
[code]$('#courseBlockListing').dataTable({"bInfo":false
,"bLengthChange":false
,"bFilter":false
,"bPaginate":false
,"bSort": false
,"oLanguage": {"sZeroRecords": "", "sEmptyTable": ""}
});[/code]
[code]
No
Course
Year
Level
Required
Credits
[/code]
...which produces the following generated HTML...
[code]
No
Course
Year
Level
Required
Credits
[/code]
...and I don't want that empty row/cell in the table body to be rendered.
Thoughts?
I see - at the moment DataTables doesn't offer an option for that. I don't remember coming across such a requirement before, but I will put it on the feature list queue and watch for any other requests for this particular future. Until then, your display:none method sounds like a good solution :-)
Allan
It's just that I want to populate the tbody via Ajax after the page has been initially rendered so don't what there to be anything initially in there.
I'll keep an eye out for future releases and hope it makes it :-)
Thanks once again for your time and efforts ($25 private donation made).
One option I've just thought of, is that you could use fnDrawCallback on the first draw (before initialisation is complete when doing an Ajax call) to remove the "spare" element. This example shows how that might be done: http://live.datatables.net/umumah/edit#javascript,html .
Thinking some more on this... you could do this: http://live.datatables.net/umumah/2/edit - no need for fnDrawCallback since the Ajax is async - while the empty() call it not :-)
Regards,
Allan