Getting row id on select row in Grid form

QuestionsGetting row id on select row in Grid form
Daniel G asked 7 years ago

Dear Sir ,

How I can Getting row id in function $e["js_on_select_row"] = "grid_onselect" when i select that row in grid form ?

Thanks

3 Answers
Abu Ghufran answered 7 years ago

PHP Code:

$e["js_on_select_row"] = "grid_select";
$grid->set_events($e);

JS Code:

<script>
function grid_select()
{
var rowid = jQuery(this).jqGrid('getGridParam','selrow'); // returns null if no row is selected (single row)
//—–^—–
}
</script>

OR you can call:
var rowid = jQuery("#list1").jqGrid('getGridParam','selrow');
where list1 is grid id.

G. Nalu answered 7 years ago

Dear Sir ,

Thanks Sir ..

And if I want to get other parameter than id when select that row ?

Abu Ghufran answered 7 years ago

You can pass that rowid in getCell along with desired column name.

var rd = jQuery('#list1').jqGrid('getCell', rowid, 'invdate');

where list1 is grid id, invdate is column to fetch.

Your Answer

12 + 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 3 / 5. Vote count: 1

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?