The condition for an empty table and the absence of results does not work correctly
The condition for an empty table and the absence of results does not work correctly
Hello! Please tell me if the condition is written correctly
As I understand it, the emptyTable parameter specifies the text if the table is empty during initialization, and here zeroRecords when searching in the table.
I use ajax to fill the table with data, when the request returns an empty response, then the value is displayed from the emptyTable parameter, which is quite logical, but when I use the search, the value from the same parameter is still displayed (emptyTable which is already not logical), since the emptyTable parameter specifies that there is no data, and zeroRecords that no matches were found
Replies
I'm seeing that here, and I can see your point. I'll defer to Allan
Colin
Almost:
language.emptyTable
is used when there is no data in the table after initialisation.language.zeroRecords
is used when there are no results due to filtering / search.language.loadingRecords
is used during initialisation.That said, I see your point. At the moment the message to say that there is no data at all in the table is taking priority over the message to say that the filter is returning zero results.
I think that is okay though, since it does actually allow you to infer extra information about the table. Consider, with this way around, you know that if you clear the filter, you are still going to have zero records. With the logic inverted, that might or might not be the case.
I'm open to discussion about it, but it isn't clear to me that the filtering message should take priority over the table empty message?
Allan