Using the grid as a "selector"

QuestionsUsing the grid as a "selector"
Victor M. Perez asked 6 years ago

I think the post below answers my question, except I don't understand it.
What I want to accomplish is to have the grid display a set of records and if I double click on one, to have a function execute. How can I accomplish this?

The Post I found searching the Forums was this:
Q) How can i get IDs of the selected rows of grid?

on client side, you can have ids in this way.

var selr = jQuery('#grid').jqGrid('
getGridParam','selrow'); // returns null if no row is selected (single row)

// array of id's of the selected rows when multiselect options is true. Empty array if not selection
var selr = jQuery('#grid').jqGrid('getGridParam','selarrrow');

1 Answers
Abu Ghufran answered 6 years ago

Following code snippet will execute your JS code on row double click. This will be placed in before we echo $out variable.

In html part …

<script>
var opts = {
'ondblClickRow': function (id) {
// your dbl click JS code – id param is record id
}
};
</script>

<div style="margin:10px">
<?php echo $out?>
</div>

Your Answer

8 + 6 =

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?