You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 2, 2019. It is now read-only.
Allowing emptyText to be a function is useful if you are dealing with searching/filtering and want to display a different "message" when no results are returned. I want to be able to display different messaging based on whether a user has no items in a particular collection versus finding no results when filtering or searching within a collection.
I think adding javascript _.result(this, 'emptyText') on line 67 in body.js would solve this problem and allow the logic to be executed whenever the empty row is shown.
As example function for emptyText may look like this:
emptyText : function(){returnthis.collection.isSearching() ? 'No results found.' : 'You have no records';}
For more context, I've extended Backbone.Pageable to implement searching and filtering in client/server/infinite modes, so figured I would recommend this enhancement for others that might be in the same boat.
The text was updated successfully, but these errors were encountered:
@wyuenho Interesting. I think they're related, but a little different. I like the suggestions in #173 to simply tap into the collection events (request/sync/error) to display loading animations. I don't think a feature like that should necessarily be built into Backgrid, as the placement/implementation of a spinner can vary depending on your project.
To solve both this issue and some requests in #173, I might recommend allowing the EmptyRow to be passed in to a new instance of Backgrid.Grid (and also pass along the collection to the empty row view, so messaging/display can reflect the current state). Might also make sense to make the empty row a property of Backgrid.Body, so overriding/extending is easy?
Allowing emptyText to be a function is useful if you are dealing with searching/filtering and want to display a different "message" when no results are returned. I want to be able to display different messaging based on whether a user has no items in a particular collection versus finding no results when filtering or searching within a collection.
I think adding
javascript _.result(this, 'emptyText')
on line 67 in body.js would solve this problem and allow the logic to be executed whenever the empty row is shown.As example function for
emptyText
may look like this:For more context, I've extended Backbone.Pageable to implement searching and filtering in client/server/infinite modes, so figured I would recommend this enhancement for others that might be in the same boat.
The text was updated successfully, but these errors were encountered: