forked from extern/egroupware
Give nextmatch a real getValue() function instead of faking it all the time.
This commit is contained in:
parent
d7375a2321
commit
e4b158be4b
@ -1194,7 +1194,21 @@ var et2_nextmatch = et2_DOMWidget.extend([et2_IResizeable, et2_IInput],
|
||||
},
|
||||
|
||||
// Input widget
|
||||
getValue: function() { return null;},
|
||||
getValue: function() {
|
||||
var _ids = this.getSelection();
|
||||
|
||||
// Translate the internal uids back to server uids
|
||||
var idsArr = _ids.ids;
|
||||
for (var i = 0; i < idsArr.length; i++)
|
||||
{
|
||||
idsArr[i] = idsArr[i].split("::").pop();
|
||||
}
|
||||
var value = {
|
||||
"selected": idsArr,
|
||||
}
|
||||
jQuery.extend(value, this.activeFilters);
|
||||
return value;
|
||||
},
|
||||
resetDirty: function() {},
|
||||
isDirty: function() { return false;},
|
||||
isValid: function() { return true;}
|
||||
|
@ -160,14 +160,15 @@ function nm_action(_action, _senders, _target, _ids)
|
||||
if(nextmatch)
|
||||
{
|
||||
// Fake a getValue() function
|
||||
var old_value = nextmatch.getValue;
|
||||
var value = nextmatch.getValue();
|
||||
jQuery.extend(value, this.activeFilters, {
|
||||
"selected": idsArr,
|
||||
"checkboxes": checkboxes_elem ? checkboxes_elem.value : null
|
||||
});
|
||||
value[nextmatch.options.settings.action_var]= _action.id;
|
||||
|
||||
nextmatch.getValue = function() {
|
||||
var value = {
|
||||
"selected": idsArr,
|
||||
"checkboxes": checkboxes_elem ? checkboxes_elem.value : null
|
||||
};
|
||||
jQuery.extend(value, this.activeFilters);
|
||||
value[nextmatch.options.settings.action_var]= _action.id;
|
||||
//if(_target && _target.id) value[_target.id] = true;
|
||||
return value;
|
||||
}
|
||||
|
||||
@ -178,8 +179,8 @@ function nm_action(_action, _senders, _target, _ids)
|
||||
|
||||
nextmatch.getInstanceManager().submit();
|
||||
|
||||
// Clear action in case there's another one
|
||||
delete nextmatch.getValue;
|
||||
// Reset action in case there's another one
|
||||
nextmatch.getValue = old_value;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user