Title: datagrid formatter disappear after used updateRow method
Post by: Aod47 on September 05, 2020, 12:41:48 AM
Dear Sir, I would like to update some cell value after close update window without reload datagrid. But after used updateRow method the column formatter that display linkbutton disappear only updated row. Could you advice how to correct. <script type="text/javascript"> function fmCmd(value, row) { var cmd = '<a href="javascript:void(0)" onclick="setTimeout(function() {' + 'viewPatron(\'GridPatron\',0)},500)' + '" class="easyui-linkbutton" iconCls="icon-aim" title="Open Update Window"></a>'; return cmd; } function updateLastAct(last_action) { var selectedRow = $('#GridPatron').datagrid('getSelected'); var rowIndex = $('#GridPatron').datagrid('getRowIndex', selectedRow); $('#GridPatron').datagrid('updateRow', { index: rowIndex, row: { last_act: last_action } }); } </script>
<table id="GridPatron" class="easyui-datagrid" border="true" idField="id" data-options=" url: 'getPatrons.ashx', method: 'post', fit: true, pagination: true, singleSelect: true, }, onLoadSuccess:function(data){ $(this).datagrid('getPanel').find('a.easyui-linkbutton').linkbutton(); } "> <thead> <tr> <th data-options="field:'expire',align:'center',resizable:true" width="9%"><b>Expire</b></th> <th data-options="field:'last_act',align:'left',resizable:true" width="12%"><b>Last Activity</b></th> <th data-options="field:'id',align:'center',formatter:fmCmd" width="9%"><b>Command</b></th> </tr> </thead> </table>
Thank you for you help.
Title: Re: datagrid formatter disappear after used updateRow method
Post by: sky-t on September 05, 2020, 11:55:22 PM
just use after update var p=$('#GridPatron').datagrid('getPanel'); $.parser.parse(p);
Title: Re: datagrid formatter disappear after used updateRow method
Post by: Aod47 on September 07, 2020, 06:37:52 AM
;D Wow, Work Great! You save my day. Thank you
|