Bootstrap-transfer doesn't allow to populate available or chosen column accordingly to incoming data. In order to do this, I changed the following lines :
// input: [{value:_, content:_}]
_this.$filter_input.val('');
for (var i in input) {
var e = input[i];
_this._remaining_list.push([{value:e.value, content:e.content}, true]);
_this._target_list.push([{value:e.value, content:e.content}, false]);
}
to :
// input: [{value:_, content:_, selected:_}]
_this.$filter_input.val('');
for (var i in input) {
var e = input[i];
if (e.selected === true) {
_this._remaining_list.push([{value:e.value, content:e.content}, false]);
_this._target_list.push([{value:e.value, content:e.content}, true]);
} else if (e.selected === false) {
_this._remaining_list.push([{value:e.value, content:e.content}, true]);
_this._target_list.push([{value:e.value, content:e.content}, false]);
}
}
Then you juste need to provide a third parameter named "selected" for each option. It must be set to true to populate the "chosen" column or false for the "available" one.
Hope this will help.
You did a great job with this plugin, by the way. Thank you.
Bootstrap-transfer doesn't allow to populate available or chosen column accordingly to incoming data. In order to do this, I changed the following lines :
to :
Then you juste need to provide a third parameter named "selected" for each option. It must be set to true to populate the "chosen" column or false for the "available" one.
Hope this will help.
You did a great job with this plugin, by the way. Thank you.