JqGrid Add custom button to Row

Posted by oirfc on Stack Overflow See other posts from Stack Overflow or by oirfc
Published on 2010-05-30T17:42:37Z Indexed on 2010/05/30 18:32 UTC
Read the original article Hit count: 1359

Filed under:
|
|

Hi there,

I am trying to add a custom button to a JqGrid that implements a 'Check Out' process. Basically, every row has a 'Check Out' button that if clicked should be able to send a post back to the server and update a shopping cart and then change the button text to 'Undo Check Out'. So far I have:

colNames: ['Id', ... , 'Action' ],
colModel: [
{ name: 'Id', sortable: false, width: 1, hidden: true},
...
{ name: 'action', index: 'action', width: 75, sortable: false }
],
...
gridComplete: function() {
            var ids = jQuery("#east-grid").jqGrid('getDataIDs');
            for (var i = 0; i < ids.length; i++) {
                var cl = ids[i];
                checkout = "<input style='height:22px;width:75px;' type='button' value='Check Out' onclick=\" ??? \"  />";
                jQuery("#east-grid").jqGrid('setRowData', ids[i], { action: checkout });
            }
        },
...

Where '???' is the part I need to solve.

Thank you in advance for your help.

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about button