Open kabirvs opened 2 years ago
Also tried this according to docs. But getting similar errors:
comboTree1 = $('#justAnInputBox').comboTree({ source : SampleJSONData, isMultiple: true, cascadeSelect: true, selected: ['0'] });
// Array, One title/id, or False value return var selectedTitles = comboTree1.getSelectedItemsTitle(); var selectedIds = comboTree1.getSelectedItemsId();
// To remove plugin comboTree1.destroy();
This is how I did and it worked (Using the sample):
comboTree2 = $('#justAnotherInputBox').comboTree({ source: SampleJSONData, isMultiple: false, }); comboTree2.onChange(function() { alert("Yeaaahhh maaannn"); let selectedIds = this.getSelectedIds(); console.log(selectedIds); });
You will receive an array.
Happy Coding!
THANK YOU. Docs are definitely lacking on this part.
Thank you for explaining this. It could not work it out by myself from the documentation. I was trying to do
comboTree2.onChange(function() { updatecontent( alert("Yeaaahhh maaannn"); ) });
which was not working as desired.
How can I get the selected value?
I have tried some way:
Is there any way to get the selected value/ids ?