开发者

How to populate a textbox by clicked a row in a jqGrid?

开发者 https://www.devze.com 2023-03-04 04:49 出处:网络
Req开发者_如何学运维uirement: 1) I want to populate a textbox with data (e.g. Amount: 600.0) when a row in the above jqGrid is clicked.

How to populate a textbox by clicked a row in a jqGrid?

Req开发者_如何学运维uirement:

1) I want to populate a textbox with data (e.g. Amount: 600.0) when a row in the above jqGrid is clicked.

Can someone direct me to a tutorial for this ?

Resources looked at:

  • Demos -- Trirand jqGrid for ASP.NET
  • jqGrid Demos

Thanks


You could use the onSelectRow event along with the getCell or getRowData methods:

$('#grid').jqGrid({
    ....
    onSelectRow: function(id) {
        var amount = $('#grid').jqGrid('getCell', id, 'Amount');
        $('#id_of_some_text_box').val(amount);
    },
    ....
});
0

精彩评论

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