Display the total number of rows in a Slickgrid table - slickgrid

Is there an accepted way to display the total number of rows in a slickgrid table. I see that there is a pager that I can include on my pages, but that comes with additional buttons/settings for pagination.
I am using a DataView object with no grouping. Ideally I'd like to simply have a trivial row at the bottom of the viewport that lists how many rows are in the table.
I could do this manually but wasn't sure if I was missing something in the Slickgrid APIs/configuration.

Use this method...to get number of rows displayed in the grid..(if no pagination is there)
grid.getDataLength();
if pagination is there....use this..
grid.getData().getPagingInfo().pageNum
grid.getData().getPagingInfo().pageSize
grid.getData().getPagingInfo().totalPages
grid.getData().getPagingInfo().totalRows // what u want

Use the onRowCountChanged for dataView argument in Slick Grid.
dataView.onRowCountChanged.subscribe(function (e,args)
{
$("#RowCount").text(args.current);
});

Related

jquery Bootgrid: get all rows data

I need to filter rows in my jQuery Bootgrid (with pagination).
How I can get ALL rows from grid?
When I try to do this $('#TableId').bootgrid().data('.rs.jquery.bootgrid')
it returns only rows in first page.
Almost there. Try this:
$('#TableId').bootgrid().data('.rs.jquery.bootgrid').rows
returns all rows data(array) that Bootgrid used right now.

Dgrid sorted but not sorted in the store?

when I sort the dgrid, clicking on some column header, the view of the grid changes. When for example I call "getSelectedRows" on the grid object, I get the list of selected rows but not sorted.
I need to get on the js, the list of sorted rows because I must print them in a pdf in the same sorting that the grid views the results.
Is there in dgrid a function, an object or something else to permit me to get this result?
Thank you very much!!!!!
It depends on which version of dgrid you are using, if you are using dgrid 0.3 you can get rendered data of grid like this from it's store
var sortedData=grid.store.query(grid.get('query'),{sort:grid.get('sort')});
in dgrid 0.4 you can just use_renderedCollection property of dgrid

jQGrid With Multiple Row Data

I have a requirement to display a single jqgrid into several lines (2 or 3). The user does not want to use the grid horizontal scroll bar and would like to see several data at once.
Anybody with an idea how to do this?
If I understand your question correctly you want to wrap rows in the grid because the grid have large number or rows. It's not possible because jqGrid are base on HTML <table> and the row (<tr>) of table can't be wrapped.
If you have grid with columns which text is long you can consider wrapping inside of cells of grid. See the answer, this one, this one and the answer too.

Client side paging on Jqgrid?

could anyone tell me how to implement client side paging on jqgrid?
Currently, my pager just shows one page which is an error. However, if I change the number of records per page using the drop down, the grid is updated accordingly. But I am unable to navigate thru the pages.
Thanks in advance
I suppose that you fill the grid in the wrong way. You don't included any code in your question, so I can only guess that you use addRowData method to fill the grid. If it's so, then you should know that the usage of addRowData method it the worst and the slowest way to fill the grid which I know.
The best way in case of datatype: 'local' is to use data option of jqGrid in combination with gridview: true. It sorts the data from the data parameter corresponds with sortname and sortorder options, create jqGrid and display the first page of the grid (the size of the page defines rowNum option). The value of data parameter should be array of items which represent the grid rows. Every item should contains properties with the names like the name property of colModel. Additionally every item of data should contains id property which unique value will be used as id attribute of rows (id of <tr> elements).

jqgrid grouping with scrolled paging - stuck

I have a scenario where i need to use scrolled paging on my jqgrid, and it works perfectly. But now i need to add dynamic grouping capabilities to the grid as well. The problem I face, is that when I group the grid, only records in teh currently loaded page get grouped, and not the whole underlying dataset. Is there a way to acheive this using jqgrid.
a. Grouping groups all rows in a dataset, not just the ones loaded in a scrolled page in the grid.
b. When expanding such a group and scrolling, the grouped rows now follow scrolled paging
Any help here would be appreciated as I have been trying to figure this out for a while now with no luck :-(
Thanks
Lokesh

Resources