Give nextmatch a real getValue() function instead of faking it all the time.

This commit is contained in:
Nathan Gray 2013-08-19 20:23:26 +00:00
parent d7375a2321
commit e4b158be4b
2 changed files with 25 additions and 10 deletions

View File

@ -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;}

View File

@ -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
{