Angular 4 WjMultiSelect selected property array in reactive forms

Posted by: umesh.vishwakarma on 1 December 2017, 1:31 am EST

    • Post Options:
    • Link

    Posted 1 December 2017, 1:31 am EST

    Hi Wijmo Team,

    I am trying to get checked items property value in the reactive forms, is this possible?Currently in build 5.20173.380 it only selects the displayMemberPath value. The object binding for the drop-down values are as below.

    {
       "id": 1,
       "text": "Test value"
    }
    

    So on multi selection I need to get an array of ID’s instead of text values.

    Please let me know if its achievable in the latest build.

    Thanks,

    Umesh

  • Posted 1 December 2017, 2:25 am EST

    This looks like a bug when I change the maxHeaderItems to 1 after the first selection the second selection, selects the current object in the array instead of only the text property in the array.

  • Posted 3 December 2017, 8:57 pm EST

    Hi,

    We are looking into. We will get back to you on this tomorrow.

    Thanks,

    Abhishek

  • Posted 4 December 2017, 5:38 pm EST

    Hi Umesh,

    The ngModel property is bind to checkedItems property for MultiSelect country. As you know checkeditems property is used to get/set checkedItems for MultiSelect control.

    We should keep in mind that objects assigned to ngModel property should be a part of datasource. Please refer to the code snippet for the same:

    $scope.data = data;
    $scope.items=[data[3]];
    <wj-multi-select items-source="data" 
                                ng-model="items"
                                display-member-path="country"></wj-multi-select>
            <p>Selected Items</p>
            <p ng-repeat="item in items">
                {{item.id}}
            </p>
    

    Hope it helps!

    ~Manish

Need extra support?

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

Learn More

Forum Channels