Dynamically created wj-combo-box is taking first value at run-time instead of

Posted by: nilesh_nichal on 23 November 2017, 9:53 pm EST

    • Post Options:
    • Link

    Posted 23 November 2017, 9:53 pm EST

    Hi Wijmo Team,

    Problem:

    When i creating combo-box on run-time with selected desire value but in combo-box displays first value.

    Scenario of use case:

    We have one form which has one static combo-box after selecting any desire value from that combo-box and clicking on add button. then it should be create new row in bottom with desire selected value in newly added combo-box.

    What i have did?

    i have one array of object which holds the row wise object and this array will grow on run-time. i have used *ngFor.

    Thanks

  • Posted 26 November 2017, 8:43 pm EST

    Hi Team,

    Any Update on my query? Awaiting for you feedback.

    Thanks

  • Posted 27 November 2017, 12:48 am EST

    Hi Nilesh,

    Can you share your template?

    ~nilay

  • Posted 28 November 2017, 4:51 pm EST

    Hi Nilay,

    Its difficult to share.

    Thanks.

  • Posted 28 November 2017, 8:50 pm EST

    Can you share your scenario in detail?

    Also, if using ngFor to add dynamic items, I would suggest you use trackBy.

  • Posted 29 November 2017, 11:41 pm EST

    Hi Nilay,

    Thanks will try and check ‘trackBy’.

    Still i will try to explain you our scenario (wj-combo-box):

    1. Have one static row, which have Combo-box with ‘Add’ button.
    2. While selecting any value from Combo-box and click on ‘Add’ button
    3. Dynamic row will get created with Combo-box ( same set of option ) selected value from static row.

    this is the scenario.

    But now, when dynamic row is generate with wj-combo-box, selected value is switching to first value of wj-combo-box.

    Thanks

  • Posted 30 November 2017, 5:56 pm EST

    Hi Nilay,

    Any query on last conversation?

    Thanks

  • Posted 3 December 2017, 8:31 pm EST

    Hi Nilesh,

    Depends on how you are generating the new items. If via code, set the value in a timeout after the combobox has initialized. If using ngFor, directly bind the combo with a model property on your component.

    ~nilay

Need extra support?

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

Learn More

Forum Channels