execute a query in a custom button?

Questionsexecute a query in a custom button?
Tasagore Seibei asked 1 year ago

Hi

 

I’ve added a custom button to my grid and when I click it I get the id of the selected field (if any). I want to update a specific field on the row and reload the grid, I guess I need to create a ajax function but I’m not sure if there is a easiest way to do it.

The button code gets the id with this:

var ids = jQuery(‘#list1’).jqGrid(‘getGridParam’,’selrow’);

si I have in ids the id of the field, now I want to execute a query like:

update mytable set status=’X’ where id=$ids

Should I use ajax for this or there is any way to define a function in the grid and just call to execute it from the javascript button code?

Thanks in advance

1 Answers
Tasagore Seibei answered 1 year ago

Done with Ajax, works fine.

Your Answer

2 + 13 =

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?