Skip to content
This repository was archived by the owner on Apr 2, 2019. It is now read-only.
This repository was archived by the owner on Apr 2, 2019. It is now read-only.

[Feature Request] Allow emptyText to be a function #332

@toekneestuck

Description

@toekneestuck

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(){
    return this.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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions