In my OutSystems grid project, I'm able to save and edit. However, when I try to delete a row, it appears to be removed, but reappears upon refreshing. I've attempted multiple solutions but haven't had success. I'm still new to this. Iam attaching my oap here.Can someone assist me with this issue?
Hi Laxmy,
I have analysed your oap. and found the root cause for this.
First of all you should debug your code, so that you can understand why it is not working.
I found during the debug your delete action is not working properly because this is not how datagrid works, your delete_student action is getting empty record everytime.
Solution:
Please refer this screenshot i am attachig from datagrid sample apps:
here you will find a page "AddRemoveRows". Here you can check how they are performing add/remove functionality.
https://www.outsystems.com/forge/component-overview/9765/outsystems-data-grid-sample
Hope this helps.
Regards,
Manish Jawla
@Manish Jawla Yes I checked .I downloaded that sample.In that also raws getting deleted.but after refreshing it appears again.Then what is the use of this?
Hi LAXMY,
I think you didn’t check it properly after adding or removing rows there is one more button there to save changes, where you can see the codes in my previous reply, you will get the changed rows, you can use that action to confirm delete and save, logic written in remove and add action is temporarily or locally that’s why when you refresh the page all data appears again, but if you check save changes logic you will understand how it’s works.
Hope this helps,
I have made the required changes to the your oap file, it's a small change.
Please have a look, now your data is deleting permanently, even after refresh it will work fine.
@Manish Jawla Thankyou for your time.Issue solved anyway.Thankyou .
Hi Laxmy,You don't need to make any major changes, your logic was working in UI only, for delete logic, you are not passing the proper data, you bound the variable which is empty. Your logic is straightforward so you can skip the Data refresh and to get the selected data you will need to use "GetSelectedRowData" and pass the data to your delete action after getting it from Deserialized.Please let me know if you have more queries.Regards,
@Anubhav Rai Thankyou.Issue solved.