I suspect this has been asked and answered previously, but I have not found the info...
I would like to display row counts after my igGrid is filtered. For example, 400 of 500 records displayed.
I am using local filtering in advanced mode and have a dataFiltered handler...
var _filtered = function(e, arg) {
var total = .... //total number of rows in the grid
var filtered = ... //number of rows visible after the grid has been filtered
$('#status').text(filtered+ " of " + total + " records displayed.");
};
How can I find the total number or rows and the number visible after filtering?
Also, is there an event to which I can bind where I can initialize the status with the total number of rows in the grid?
$('#grid').on('iggridloaded', function () {
var total = ... // total rows in the grid
$('#status').text(total + " records");
});
Thanks for the help
ROB
Excellent.
Thanks for your help. I was thinking of handling the rowsRendered event which appears to be triggered when the grid initially displays and when a filter is applied. This would replace handling both the dataFiltered and created events.
Again,
Thank you for the help.
Hello Rob,
You can get the number of rows displayed in the grid using the following syntax:
$('#grid1').igGrid('rows').length
And the total number of rows:
$('#grid1').igGrid('option','dataSource').length
And about your second question - I would suggest you to handle the created event. Here you can find all events and their descriptions - http://help.infragistics.com/jQuery/2012.2/ui.iggrid#events.
Please let me know if you have any questions.