Help on usage of multi-select component

Posted by: nileshgokhale45 on 14 September 2017, 11:46 am EST

  • Posted 14 September 2017, 11:46 am EST

    I am trying to use a multi-select component and I am not able to find an example which shows all aspects of the component. I used the obvious properties of the component, but there are some properties which I am not able to understand. I also need to limit the user from selecting more than 3 items from the multi-select, So I used the checkedItemsChanged to control the selection, but unfortunately I do not get anything in the EventArgs. Can anyone help me figuring out whats going wrong or point me to an example for multi-select?

    here is a sample code.

    <wj-multi-select  [isRequired]="false" [itemsSource]="departmentDropItems" [checkedItems]="departmentSelectionModel" [selectedValuePath]="'id'" [displayMemberPath]="'text'" [headerFormat]="'{count:n0} Departments Selected'"
                            style="width:100%" (checkedItemsChanged)="onDepartmentsUpdateWijmo($event)"></wj-multi-select>

    here is the function where I want to limit the number of selections.

    
        onDepartmentsUpdateWijmo(ev: wijmo.EventArgs) {
            debugger    ;
            //this.departmentSelOut = ev;
        }

    I am not sure whether I am doing this right, really appreciate anyhelp.

  • Posted 26 October 2018, 8:15 am EST

    Hi Abhishek,

    We are not able to populate / set checkedItems by default is the item source is of type object array

    https://stackblitz.com/edit/angular-d4fove?file=app%2Fapp.component.ts

    item source: [{value:1,label:‘Fatal’}, {value:2,label:‘Error’}]

    how to set checkedItems by default to fist item in the array

    thanks

    Ahmed

Need extra support?

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

Learn More

Forum Channels