dark_mode EN
  • Method WTable :DeleteFromService
  • Parameters
    cService

    Name of the method in the WDoc where the code that will perform the delete operation is located

    oSource

    WButton or WLink type object that, when clicked, will trigger the action.

  • Return value

Automatically creates a WFetch object that allows deleting the current row without leaving the current web page. The service must return a JSON indicating whether the deletion operation should be performed. For further information consult the programming guide.

Sample:

oModal := oPackage:ShowModal("xaWeb: Table CRUD", "Confirm row deletion?", {"OK", "Cancel"} )
...
WITH OBJECT oModal
  :OnClick( 1, ::oTable:DeleteFromService( "Srv_TableDelete", oBtn4 ) )
END WITH
...
oBtn4:OnClick := oModal
...
METHOD Srv_TableDelete( hParam ) CLASS WDocMain
  LOCAL hResult := { => }
  HB_HSet( hResult, "pass", .t. )
RETURN HB_JsonEncode( hResult )

Previous chevron_left Next chevron_right