I am building an addable ComboBox - i have it mostly working, however, whenever I add a new Option, it appears, but its blank (i.e. the first Option in the list):
I am directly adding it to the ComboBox component reference using:
Note that the structure of the "newItem" variable is correct for the fields I am passing to the ComboBox too...
All other, pre-existing items render, as you can see, but the new one shows, but is blank.
the "customValue" variable is definitely populated too.
I have also tried adding directly to the ComboBox control's data source (this.state.options) via a this.setState call, which will trigger a re-render, but in this case NONE of the Options are rendered (though they're actually "there", they just display blank, like the first item in the screenshot)
When I inspect the markup, I see the following:
Where the first <li> doesnt have any child nodes ad the 2nd one does (which I expanded).
Instead of being blank, I am expecting the first <li> to look something like the last <li>, which I have also expanded.
I am also using a custom "itemTemplate" for the "custom" items I am adding to the list (anything barring phase-1 to phase-5). You can see this working correctly for the last <li> element.
Here is the code for the itemTemplate:
Ideally I would just trigger the whole this.state.options array to be re-created, rather than directly adding the option to the control as this allows me more flexibility with other, unrelated things im working on in this wrapper component for the syncfusion ComboBox component.
Any ideas of what I am doing wrong/missing?
ok. I fixed this. It was simply a case of adding in a:
Mike,
Thanks for your update.
Regards,
Sureshkumar P