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

ahzzaxzhyo7wahzzaxzhyo7w Posts: 5Questions: 1Answers: 0

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

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    I'm seeing that here, and I can see your point. I'll defer to Allan :)

    Colin

  • allanallan Posts: 63,685Questions: 1Answers: 10,500 Site admin

    the emptyTable parameter specifies the text if the table is empty during initialization, and here zeroRecords when searching in the table.

    Almost:

    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

This discussion has been closed.