jQuery UI Widgets Forums Angular Integrate ngModel on dropdownlist when checkboxes is true

This topic contains 1 reply, has 2 voices, and was last updated by  Martin 3 years, 8 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author

  • jliterado
    Participant

    I have the dropdownlist below:

    <jqxDropDownList id="{{id}}" [auto-create]="false"
                    (onClose)="close($event)"
                    (onCheckChange)="checkChange($event)" #dropdown></jqxDropDownList>

    The dropdownlist is initialized in the component using json.

    this.dropdownListSettings = {
                theme: 'someTheme',
                source: this.source,
                checkboxes: true,
                height: 28,
                width: '99.5%',
                displayMember: "someDescription",
                valueMember: "someValue",
                placeHolder:  "Choose",
                //To show the selected items in the widget
                selectionRenderer: (htmlString) => {
                    let items = this.dropdown.getCheckedItems();
                    let checkedItems = '';
                    let allSelected = '';
                    if (angular.isDefined(items)) {
                        angular.forEach(items, (item, index) => {
                            if (item.label === this.allCategories) {
                                allSelected += this.allCategories;
                                return false;
                            } else {
                                if (checkedItems.length > 0)
                                    checkedItems += ", ";
                                checkedItems += item.label;
                            }
                        });
                    }
    
                    if (allSelected != ''){
                        return allSelected;
                    } else {
                        return checkedItems.length > 0 ? checkedItems : "Choose";
                    }
                }
            }
            this.dropdown.createComponent(this.dropdownListSettings);

    How do I implement ngModel? and also I want to use it in form-control


    Martin
    Participant

    Hello jliterado,

    Please, take a look at the following Example.

    Best Regards,
    Martin Yotov

    jQWidgets Team
    https://www.jqwidgets.com/

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.