Custom Button and grid data

QuestionsCustom Button and grid data
Ananda Theerthan asked 8 years ago

Hi,
I have added custom button on the form for printing.
When the button is clicked, I need value of col2 from any row in the grid to be passed as parameter to another PHP page. How can i achieve this?

1 Answers
Abu Ghufran answered 8 years ago

Here is some sample code, you can place in button click function.

// get selected row id
var rowid = jQuery(this).jqGrid('getGridParam','selrow');

// fetch col2 value of that column
var val = jQuery('#list1').jqGrid('getCell', rowid, 'col2');

// call jscode to pass. e.g.
window.open("export.php?col2="+val);

Your Answer

12 + 16 =

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?