开发者

Modifying the jqGrid editurl

开发者 https://www.devze.com 2023-03-30 09:04 出处:网络
I\'ve been battling some unfamiliar jqGrid code and I\'m hoping someone with more insight can move me toward where I need to be in far less time than it\'s taken me to get nowhere.

I've been battling some unfamiliar jqGrid code and I'm hoping someone with more insight can move me toward where I need to be in far less time than it's taken me to get nowhere.

I have a grid displaying registration info. When I click on a row, a Refund button appears. If I click that, a request is sent to the url defined in the grid's editurl property. That much I think I understand reasonably well. Maybe. Anyway, I need to capture that Refund click in order to launch a dialog (maybe a confirm() box) and modify the editurl with the return value before it's sent.

The existing column as defined in colModel looks like this:

{ name:'options',sortable:'false',width:60,editable:true,edittype:'button',
  editoptions:{
    value:'Refund', 
    dataEvents:[{
      type:'click',
      fn: function(e){ 
        jQu开发者_运维知识库ery('#registrationsTable').jqGrid('saveRow',lastRegistrationSelected,showStatus);
      }
    }]
  }
}

Any insight would be appreciated. I'm getting completely bogged down in the docs.

Thanks.


It seems to me that you can just use

jQuery('#registrationsTable').jqGrid('saveRow',lastRegistrationSelected,showStatus,
                                     anyUrl);

instead of

jQuery('#registrationsTable').jqGrid('saveRow',lastRegistrationSelected,showStatus);

Look at the possible parameters of the saveRow method. In you need an additional conformation dialog you can insert it before the call of saveRow method.

0

精彩评论

暂无评论...
验证码 换一张
取 消