Now:
/**
value - selected value
$item - selected option DOM
*/
onItemAdd(value, $item)
Expected:
/**
value - selected value
$item - selected option DOM
item - selected object data with all data pass bt create/load
*/
onItemAdd(value, $item, item)
Workaround:
selectize.js, change line:
-- self.trigger('item_add', value, $item);
++ self.trigger('item_add', value, $item, $option);
in your code by $option we can pass some extra data but access is complex eg.
onItemAdd: function(value, item, option) {
var $cell = $($(this)[0].$wrapper).parent(),
$addressInput = $cell.find('.address'),
$option = $(option),
$address = $option.find('.address');
//....
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
As far as I can tell all current options can be accessed through this.options, and so to get the selected option the following worked for me:
...
onItemAdd: function(value, $item) {
console.log(this.options[value]);
},
@leifdenby saved my day!
closing stale issues older than one year.
If this issue was closed in error please message the maintainers.
All issues must include a proper title, description, and examples.
Most helpful comment
As far as I can tell all current options can be accessed through
this.options, and so to get the selected option the following worked for me: