Title: [SOLVED] edatagrid destroyRow and reload Post by: jega on March 23, 2023, 03:44:11 AM Hi.
Have problems with edatagrid When hit button to destroyRow, it calls the url in destroyUrl and it deletes from db. But, it never removes it from the grid. I can just remove the destroyUrl method and then it removes it from the grid, but then it cant call the db. Then i thought i could just reload the grid after destroy the record, but it never get into onDestroy. <a id="removeButton" href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-remove" onclick="$('#dgLimitList').edatagrid('destroyRow')">Fjern</a> $('#dgLimitList').edatagrid({ url: 'getfromdb.asp?st=limitlist&dataident='+row.dataIdent, onDestroy: function(index,row){ console.log('test'); }, destroyMsg:{ norecord:{ title:'Bemærk', msg:'Ingen række valgt.' }, confirm:{ title:'Bekræft', msg:'Er du sikker på den skal slettes?' } }, autoSave: true, saveUrl: 'data_limitlist.asp?st=insert&dataident='+row.dataIdent, updateUrl: 'data_limitlist.asp?st=update', destroyUrl: 'data_limitlist.asp?st=delete' }); Any help Regards Jesper Title: Re: edatagrid destroyRow and reload Post by: jarry on March 26, 2023, 07:05:02 PM Please look at this example https://www.jeasyui.com/demo/main/index.php?plugin=Application&theme=material-teal&dir=ltr&pitem=CRUD%20DataGrid&sort=asc. The 'destroyRow' method works fine.
Title: Re: edatagrid destroyRow and reload Post by: jega on March 27, 2023, 02:45:03 AM Hi jarry
Yes i see. My code is the same, but not working. After invistigating i found that you send an json response success:true back. So when i call my file in destroyUrl it must respond with response.write "{" & chr(34) & "success" & chr(34) & ":" & chr(34) & "true" & chr(34) & "}" Then it works |