Send back to server both checked and unchecked values if autoloading is used

This commit is contained in:
Hadi Nategh 2015-07-28 13:04:19 +00:00
parent 422a341513
commit a5f347d484

View File

@ -442,7 +442,30 @@ var et2_tree = et2_inputWidget.extend(
*/
getValue: function() {
if(this.input == null) return null;
return this.options.multiple ? this.input.getAllChecked().split(this.input.dlmtr) : this.input.getSelectedItemId();
if (this.options.multiple)
{
var allChecked = this.input.getAllChecked().split(this.input.dlmtr);
var allUnchecked = this.input.getAllUnchecked().split(this.input.dlmtr);
if (this.options.autoloading)
{
var res = {};
for (var i=0;i<allChecked.length;i++)
{
res[allChecked[i]]= {value:true};
}
for (var i=0;i<allUnchecked.length;i++)
{
res[allUnchecked[i]]= {value:false};
}
return res;
}
else
{
return allChecked;
}
}
return this.input.getSelectedItemId();
},
/**