forked from extern/egroupware
When setting a validation error for a widget on a tab, switch to that tab so the user can see it.
This commit is contained in:
parent
5a6ed7c407
commit
54eb53cdba
@ -187,6 +187,19 @@ var et2_inputWidget = et2_valueWidget.extend([et2_IInput,et2_ISubmitListener],
|
||||
{
|
||||
this.showMessage(_value, "validation_error");
|
||||
$j(node).addClass("invalid");
|
||||
|
||||
// If on a tab, switch to that tab so user can see it
|
||||
var widget = this;
|
||||
var tab = this;
|
||||
while(widget._parent && widget._type !='tabbox')
|
||||
{
|
||||
tab = widget;
|
||||
widget = widget._parent;
|
||||
}
|
||||
if(!widget || typeof widget.setActiveTab == 'undefined') return;
|
||||
var index = widget._children.indexOf(tab);
|
||||
widget.setActiveTab(index);
|
||||
console.log(widget);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user