Confirm Box (return values from control modal)
ok ok my fault...
i neve return at the funciont confirm_delete.... anyway now i tried to make (at the end of the function)
return Control.Modal.open(confirmacion);
but it always return true and close itself
Posted April 13th, 2007 at 6:35am by Surt
Any idea? How to return values to the parent function from a Control Modal box?
Posted April 16th, 2007 at 2:09am by Surt
I'm not sure I entirely understand the finer points, but you'll need to program that logic outside of Control.Modal.
open() and close() aren't meant to return anything, because they aren't aware of the logic or contents of your modal window.
Posted April 17th, 2007 at 2:35pm by ryan
Ok, no way then to return a value (from a modal control) to a parent function wich contains a modal control.
So i am planing to have a hidden input, the buttons in the control modal will fill that input and the parent function will read the value.
This way:
input hidden in page
event that launch confirm box
|
|
confirm function {
- control box opens with text and 2 buttons (accept and cancel)
- when click in a button fill with a value the input hidden in page and close the control modal
- take value from hidden input
- return true or false
}
If someone discover another way to make it, please, let me know
Posted April 18th, 2007 at 2:06am by Surt
Still the same problem
afterclose returns a boolean value, the problem is that i can't take that value on the parent function.
Is possible to take the afterclose value from a control modal?
my target is:
onclick call a function - that function opens a control modal with 2 buttons (accept and cancel) - that control modal have an afterClose that returns me a value true or false depends on button (achieved) - the function that opens the control modal take that afterClose returns and return it. - done
I think that is imposible (at the moment) and that could be done through the control modal modification, don't know. Still.. any idea?
Posted April 18th, 2007 at 4:21am by Surt
i also make function confirm but send to it id of form element and message
Control.Modal.open(confirmacion, {opacity: 0.8,containerClassName: 'confirm',overlayClassName: 'confirm',overlayCloseOnClick: false});
confirmacion is div with msg and two buttons, both got onlick event Control.Modal.close(); and yes got $('myform_id').submit();
Posted October 29th, 2007 at 4:42am by wk
Hi,
i am triying to make a "confirm" box. better try to explain with a simple example:
so it means a button delete with a function to confirm.
the function: function confirm_delete(msg) { Control.Modal.load(); var confirmacion = msg+ ""+ ""; Control.Modal.open(confirmacion, {afterClose: function(){return true;}}); }
ok you will see an "afterClose" i put it just to try, but no way, even with afterclose return true nothing happends.
What the problem at my code?
Posted April 13th, 2007 at 6:04am by Surt