Wijmo Combo box show in active items

Posted by: pmithilesh on 27 September 2018, 10:52 am EST

    • Post Options:
    • Link

    Posted 27 September 2018, 10:52 am EST

    Hi I am using wijmo combo box right now

    we have situation where user can make item inactive or active in that situation we might have item which does not exist in our item source but it was selected before

    so i want to show that item selected by default but not in item source

    is there any way i can do this?

    Thanks

  • Posted 28 September 2018, 3:32 am EST

    If we understand correctly then, you want to show some value in comboBox which is not the part of its itemsSource. You may do so by one of the following approaches:

    • Set isEditable property to true, this will allow ComboBox to have value in the input field which is not part of its itemsSource

    • Make the ComboBox’s source dynamic, what it means is that first assign an itemsSource to the comboBox which is a superset of combo’s original itemsSource and value that you want to display, then handle the isDropDownChanging event and assign the original source to the combo’s itemsSource.

    Please refer to the following sample for the same: https://stackblitz.com/edit/angular-cstpwn?file=app%2Fapp.component.html

    If this does not fulfil your requirement then please feel free to explain further about your requirement.

    ~Sharad

  • Posted 28 September 2018, 8:54 pm EST

    Hi Sharad,

    Thats exactly what i was looking for Thanks so much

    I have one more requirement scenario is there are few items which are inactive in itemsource but i want them to be shown in drop down and disabled but user can not select them i am using angular 2 i found few post for angular 1

    Thanks

  • Posted 1 October 2018, 1:03 am EST

    To disable certain items you may handle formatItem event and add ‘wj-state-disabled’ class to the required items’ classList.

    Please refer to the following sample demonstrating the same: https://stackblitz.com/edit/angular-gukepn?file=app%2Fapp.component.ts

    ~Sharad

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels