Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Optional on delete confirmation dialog

    I would be great to have an optional dialogue that asks for confirmation if the user is going to remove some records.
    An easy way would be to add a simple option, e.g.
    Code:
    ListGrid.setCanRemoveRecords(true);
    ListGrid.setConfirmRemoveRecords(true);
    //optionally, set dialogue title and message 
    ListGrid.setConfirmRemoveDialogue(String title, String message);
    A more fine grained way would be to provide a handler that determines, whether a record should really be deleted. The developer then could add some additional information into the dialogue or do some other actions.
    Code:
    ListGrid.setDataRemoveHandler(new dataRemoveHandler{
       onRemove(Records[] records){
          //create message text
          String message = createDeletionConfirmMessage(records);
          SC.say("Confirm deletion", message, new BooleanCallback() {	
    			@Override
    			public void execute(Boolean value) {
    				return value;
    			}
    		});
    )
    Would also be great if a dataRemovedHandler, i.e.
    Code:
    ListGrid.setDataRemovedHandler(DataRemovedHandler handler)
    was added at the same time.
    see: http://forums.smartclient.com/showthread.php?t=10925

    Thanks for your attention & Cheers
    fatzopilot
    Last edited by fatzopilot; 2 Dec 2010, 06:19.
Working...
X