select all rows of grid or actual SQL query

Questionsselect all rows of grid or actual SQL query
Lubos Vitu asked 9 years ago

Can I read somewhere the actual sql query from php or java?
When I use : var rowid = jQuery(this).jqGrid('getGridParam','selrow'),
I read only the current page of grid.
I need all the rows of the grid according to the current filter or actual SQL query.

Thanks.

1 Answers
Abu Ghufran answered 9 years ago

In JS you can use (where list1 is grid id)

var rows = $('#list1').jqGrid('getDataIDs');

e.g. To select all grid rows

// reset all selection
jQuery('#list1').jqGrid('resetSelection');

// get all ids and select
var ids = jQuery('#list1').jqGrid('getDataIDs');
for (i = 0; i < ids.length; i++) {
jQuery('#list1').jqGrid('setSelection', ids[i], true);

Your Answer

3 + 12 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?