custom-grid-button

Questionscustom-grid-button
pierre mata asked 7 years ago

Hi Abu, i try set a custom button, having this:

<input type="button" value="Edit" onclick="jQuery('#edit_list1').click()">
<input type="button" value="Delete" onclick="jQuery('#del_list1').click()">

here there's no problem, this invoke the funcionality of the edit button of the toolbar. But if i have a custom button in the toolbar and i want to do the same with that…

first add in js the button:

jQuery(document).ready(function(){

jQuery('#list1').jqGrid('navButtonAdd', '#list1_pager',
{'caption' : 'Generar Pago', 'buttonicon' : 'ui-icon-extlink', 'onClickButton': function()
{
var selectedRows = jQuery('#list1').jqGrid('getGridParam','selarrrow');
window.open("facturar.php?id="+selectedRows,'_self')
},
'position': 'last'
});

The question is: how to do for invoke the behavor in my custom button like the edit button of the toolbar???

what value set instead of #edit_list1???

i try this without luck…

<input type="button" value="Facturar" onclick="jQuery('#list1_pager').click()">

thanks…

1 Answers
Abu Ghufran answered 7 years ago

Just like caption, you can also set 'id' attribute of new toolbar button: see image
http://prntscr.com/gll2wz

After that you can use it in same way as edit_list1: see image
http://prntscr.com/gll2ol

Your Answer

9 + 10 =

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?