Base solution for your next web application
Open Closed

ComboBox with Live Search #925


User avatar
0
teddylim created

Hi,

I'm trying to convert the normal ComboBox for Editions field in the Create Tenant screen to ComboBox with Live Search similar to the Language Text screen. However, it's giving me a blank entry. Please help me in pointing up the problem. Thanks.

The original code is:

<div class="form-group form-md-line-input form-md-floating-label no-hint">
                <select id="TenantEditionSelectionCombobox" class="form-control edited"
                        ng-options="vm.getEditionValue(item) as item.displayText for item in vm.editions"
                        ng-model="vm.tenant.editionId">
                </select>
                <label for="TenantEditionSelectionCombobox">@L("Edition")</label>
            </div>

And, the revised code is

<div class="form-group">
                <label for="TenantEditionSelectionCombobox">@L("Edition")</label>
                <select id="TenantEditionSelectionCombobox" class="form-control bs-select"
                        ng-model="vm.tenant.editionId"
                        ui-jq="selectpicker"
                        data-live-search="true">
                    <option ng-repeat="item in vm.editions"
                            value="{{vm.getEditionValue(item)}}">
                            {{item.displayText}}
                    </option>
                </select>
            </div>

2 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    You must refresh your selectpicker. Implement something similar to

    ng-change="vm.languageChanged()"
    

    in language creation modal.

    just call this code in change event of select picker similar to language creation modal.

    setTimeout(function () {
    	$('#TenantEditionSelectionCombobox').selectpicker('refresh');
    }, 0);
    
  • User Avatar
    0
    teddylim created

    Hi,

    You are right. I need to refresh the selectpicker to display the ComboBox options. It's working now. Thanks for your help.

    Cheers, Teddy