Zend Framework fancybox confirmation dialog with ajax and posted values -


I have created a confirmation page to delete an item. It works perfectly.

Now I want to show the confirmation page in the faxbox, still pass all the variables and delete the data or close the dialog.

It is important that the process still works as it does now (remove-> confirmation page-> redirect / deletion) so that Javascript can disable disabled users without performing any of these actions. .

Now I am reading about Zend Framework, Ajax, JSON and more, but the less I read, the less I understand. In essence, my question:

I want to pass a variable in the fancy box and if the 'yes' deletion has to be performed or the 'no' dialogue should be closed, it should be closed to the jnd framework and jquery Is within

Any suggestions or suggestions are appreciated!

You need to use content switching in your AJAX which will properly present your action. , For example:

function confirmDeleteAction () {if ($ this-> _request-> isxmlHttpRequest)) {// This is Ajax so we disable Layout $ - Want-gt; _helper-> Layout-> Disabled (); // think you want to use a different view here: viewRenderer ('yourview')} // normal code can be found here function deleteAction () {// You probably do not want to show anything here, just delete Do the logic and redirect, so you do not have to worry about where it is coming from)

And in your fancy box, there is a scene that has a form and two buttons. Should point out the form of your deletion Areas get whatever with the ID of removal as the ultimate. Set up some JavaScript that says something like (and this is the original code, but you can easily change it):

  $ ('confirmButton'). AddEvent ('click', function (e) (E 'predicate default (); this.get (' form '). Submit ();} $ (' Cancel Button ') addEvent (' click ', function ) {E.preventDefault (); $ ('fancybox'). Destost (); // I'm not sure that there is an ID for fancybox in it, it has never been used)  
< / Div>

Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -