Handle if button onclick didn't get compiled. Still a problem with variable insertion though

This commit is contained in:
Nathan Gray 2011-09-22 23:03:37 +00:00
parent f7b2a2b02f
commit c622957b40
2 changed files with 17 additions and 3 deletions

View File

@ -91,8 +91,22 @@ var et2_button = et2_baseWidget.extend([et2_IInput, et2_IDetachedDOM], {
// Execute the JS code connected to the event handler
if (this.options.onclick)
{
if (!this.options.onclick())
// onclick needs to get current values
if(typeof this.options.onclick == "string") {
// Don't change this.options.onclick so we can do this again
var onclick = et2_js_pseudo_funcs(this.options.onclick, this.id);
if(onclick.indexOf("$") >= 0 || onclick.indexOf("@") >= 0) {
var mgr = this.getArrayMgr("content");
if(mgr) onclick = mgr.expandName(onclick);
}
onclick = new Function(onclick);
if(!onclick())
return false;
}
else if (!this.options.onclick())
{
return false;
}
}
// Submit the form

View File

@ -861,8 +861,8 @@ var et2_link_list = et2_link_string.extend({
$j(document.createElement("td"))
.appendTo(row)
.addClass(columns[i])
.text(_link_data[columns[i]])
.click( function(){egw.open(_link_data.id, _link_data.app, "edit", _link_data.extra);});
.click( function(){egw.open(_link_data.id, _link_data.app, "edit", _link_data.extra);})
.text(_link_data[columns[i]]);
}
// Date