There is no grid option to display a message if the grid is empty
See original GitHub issueHey guys, so there doesn’t seem to be an easy option to display a message in the event of an empty grid. I was able to use the directive below which I got from https://github.com/angular-ui/ng-grid/issues/496. But that seemed to have been closed because it was a 2.x problem. Do you think a functionality like this could be added?
.directive('showEmptyMsg', function ($compile, $timeout) {
return {
restrict: 'A',
link: function (scope, element, attrs) {
var msg = (attrs.showEmptyMsg) ? attrs.showEmptyMsg : 'Nothing to display';
var template = "<p ng-hide='data.length'><b>" + msg + "</b></p>";
var tmpl = angular.element(template);
$compile(tmpl)(scope);
$timeout(function () {
element.find('.ui-grid-viewport').append(tmpl);
}, 0);
}
};
})
Issue Analytics
- State:
- Created 9 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Display a message within the Kendo grid when it's empty
I've purposely misspelled the data route, in order to have an empty grid. To see it with content, simply comment / uncomment these...
Read more >Show a message when the grid is empty | Infragistics Forums
I want to show a message (in the grid) when there is no data shown in the grid. I want to include the...
Read more >how to display empty gridview with a message "No data ...
I want to display Empty Gridview with the message "No Data Available" ... Then bind the grid with this table when there is...
Read more >Grid says "No items to display", but the request and response ...
Grid says "No items to display", but the request and response look fine. ... to be perfectly good JSON, the grid remains empty...
Read more >Display message when data grid (!!) is empty - Mendix Forum
Display message when data grid (!!) is empty ... Consider upgrading to Datagrid 2. It has empty state functionality out-of-the-box. You can find ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
You can transclude anything you want into the grid. Here’s a plunker showing how to do a “No Rows” message: http://plnkr.co/edit/156wBdD5ogLGcKamP3lJ?p=preview
@c0bra much appreciated!