deleting a row in a data grid - Forum - Mobile - Progress Community

deleting a row in a data grid

 Forum

deleting a row in a data grid

This question is answered

Hi there

I have linked a temp-table to a data grid on my mobile app. I am using input controls in my grid so that the user can amend a column in the row if they need to. I now need to put a button at the end of each row to allow the user to delete the temp-table record if they need to. From the client side how do i flag the row for deletion? is it possible to mark- row-state so that when i loop through my dataset on the appserver side i look for the where the rowstate is  equal to ROW-DELETE and delete this record? Can someone please advise on a approach on how to do this or on an alternative if the above is not possible.

Verified Answer
  • There's a remove() method in the JSDO. The snippet below is an example of its use.

    var vehicle = VehicleOrderService_BrandDataService_JSDO.jsdo
      .eVehicle
      .findById($(selectedElement).attr('data-vehicle-id'));
    
    vehicle.remove()


    When you remove a record client-side, you can then call an *_Update service operation. That will cause the delete operation to be called on the server, and you can now find and mark PDS records as deleted. Make sure that when you call the Update operation that you supply an _id value (you can map it from localStorage) so that the JSDO knows which record you are updating.

    hth,

    -- peter

All Replies
  • Hi Meyrick,

    Allowing Before-Images is on the cards for OpenEdge 11.4 and this would do the job you are after. Other then that, you would probably have to have a hidden field in the temp-table to handle this behaviour or delete the rows on a row by row basis. I would need to check if there are other options but thats my first thought.

    Let me know if this helps.

  • There's a remove() method in the JSDO. The snippet below is an example of its use.

    var vehicle = VehicleOrderService_BrandDataService_JSDO.jsdo
      .eVehicle
      .findById($(selectedElement).attr('data-vehicle-id'));
    
    vehicle.remove()


    When you remove a record client-side, you can then call an *_Update service operation. That will cause the delete operation to be called on the server, and you can now find and mark PDS records as deleted. Make sure that when you call the Update operation that you supply an _id value (you can map it from localStorage) so that the JSDO knows which record you are updating.

    hth,

    -- peter