mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-25 17:33:49 +01:00
Add a get_value() function to allow access to values outside of callback
This commit is contained in:
parent
df8f6b9460
commit
f5297f17a7
@ -260,17 +260,25 @@ var et2_dialog = et2_widget.extend({
|
|||||||
* @param button_id integer The ID of the clicked button
|
* @param button_id integer The ID of the clicked button
|
||||||
*/
|
*/
|
||||||
click: function(target, button_id) {
|
click: function(target, button_id) {
|
||||||
|
if(this.options.callback)
|
||||||
|
{
|
||||||
|
this.options.callback.call(this,button_id,this.get_value());
|
||||||
|
}
|
||||||
|
// Triggers destroy too
|
||||||
|
this.div.dialog("close");
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the values of any widgets in the dialog. This does not include
|
||||||
|
* the buttons, which are only supplied for the callback.
|
||||||
|
*/
|
||||||
|
get_value: function() {
|
||||||
var value = this.options.value;
|
var value = this.options.value;
|
||||||
if(this.template)
|
if(this.template)
|
||||||
{
|
{
|
||||||
value = this.template.getValues(this.template.widgetContainer);
|
value = this.template.getValues(this.template.widgetContainer);
|
||||||
}
|
}
|
||||||
if(this.options.callback)
|
return value;
|
||||||
{
|
|
||||||
this.options.callback.call(this,button_id,value);
|
|
||||||
}
|
|
||||||
// Triggers destroy too
|
|
||||||
this.div.dialog("close");
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user