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

This commit is contained in:
Hadi Nategh 2015-07-24 13:33:27 +00:00
parent eb2ec31a4e
commit 310c241ca4

View File

@ -442,7 +442,30 @@ var et2_tree = et2_inputWidget.extend(
*/ */
getValue: function() { getValue: function() {
if(this.input == null) return null; 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();
}, },
/** /**