Jump to content


Showing what rows will be affected during delete action instead of a confirmation dialog box

delete

  • Please log in to reply
3 replies to this topic

#1 PunkMaster

PunkMaster

    Newbie

  • Members
  • Pip
  • 7 posts

Posted 20 August 2013 - 08:05 AM

Hi Everyone 

 

Am developing a content management system with grocery crud. What am looking for is to have a custom confirmation box which shows pages/menu or section that will be deleted if a user tries to delete a parent record that has one or more child record in a database. 

 

Consider the scenario where you have  a product page with child page like product one, product two, and so forth. Then i want  the delete confirmation box to show something like "you're about to delete product page which will automatically delete product one page, product two page... and if a user click OK it does what it says 

 

Anyone with an idea would be much appreciated 



#2 Amit Shah

Amit Shah

    grocery CRUD Master

  • Advanced Member
  • PipPipPip
  • 1,192 posts
  • LocationMumbai, India

Posted 20 August 2013 - 10:24 AM

Well you have to take control of the delete button .. and before it can perform the delete, you can make a call to the underlying ajax function to retrieve the related data / content and then prompt user for confirmation on the same. That is how you can set it with ease.

If you do not wish to take control of the default functional delete button ... then unset the delete action and there you just add your own delete button which on click makes a call to javascript function .

and this u can define it in a javascript file and add to crud by set_js

 

Hope the solution works out for you



#3 davidoster

davidoster

    Grocery CRUD Ninja

  • Advanced Member
  • PipPipPip
  • 1,068 posts
  • LocationAthens, Greece

Posted 21 August 2013 - 10:27 AM

The same can be achieved with callback_delete.

It's only a matter of preference which one somebody might use.


____________________________________________________________

 

rtfm_small.jpg---!!!Please read these guidelines before asking to the forums!!!---

____________________________________________________________

 

David Oster aka George Pasparakis,
http://odphotography.com
http://eletter.gr


#4 Amit Shah

Amit Shah

    grocery CRUD Master

  • Advanced Member
  • PipPipPip
  • 1,192 posts
  • LocationMumbai, India

Posted 21 August 2013 - 03:19 PM

True ... very true :)







0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users