ui-select2

Protractor how to test select2

我的未来我决定 提交于 2019-12-30 07:16:23
问题 I have a select2 drop-down where you need to first enter 2 characters and then select your item. I am unable to test this with Protractor. var select2 = element(by.css('div#s2id_person')); select2.click(); select2.sendKeys('ip'); select2.sendKeys(protractor.Key.ENTER); The following gets an error about being unable to focus the element when you try to sendKeys. 回答1: The following snippet successfully activates and selects the first option in a select2 widget, it allows for loading options

ng-model is not getting changed in ui-select

霸气de小男生 提交于 2019-12-19 12:33:41
问题 I'm trying to achieve something very straightforward: <ui-select multiple ng-model="company.stack" theme="bootstrap"> <ui-select-match>{$$item.name$}</ui-select-match> <ui-select-choices repeat="technology in technologies | filter: $select.search"> <div ng-bind-html="technology.name | highlight: $select.search"></div> </ui-select-choices> </ui-select> When changing the objects, the changes are not reflected in the model company.stack. I tried changing it to $parent.company.stack, but it still

Combining ng-grid and ui-select2: unable to select a value

萝らか妹 提交于 2019-12-12 00:44:28
问题 In the editableCellTemplate of an ng-grid, I wanted to use a more user-friendly dropdown, and I found ui-select2 to be a good one. The thing is however, that any click on this component, when it is used inside the ng-grid, results in the cell juming back to non-editable mode. This way I can't select another value using the mouse (I can using the arrows on my keyboard). When I put the dropdown in the cellTemplate, it works, but it should also work in the * editable *CellTemplate. Some code to

How to dynamically change the URL in Select2 using AJAX?

纵饮孤独 提交于 2019-12-10 21:53:41
问题 I am using ui-select2 in angularjs for remote data access. I am having a drop down, based on the value chosen in dropdown the URL present in the ajax call should change dynamically , so that I can get the data from that particular URL. Is it possible to change the URL dynamically based on the value present in the dropdown? 回答1: I've resolved this problem using function in ajax property: ajax: { url: function () { return '/product/' +$scope.campaign.advertiser + '/tags/'; }, ... } 来源: https:/

formatSelection not working in select2.js

最后都变了- 提交于 2019-12-08 01:04:32
问题 I am using select2.js to populate the field with multiple values using ajax call. Below is the code that I am using. HTML <input id="id_test_name" class="form-control"> Script <script type="text/javascript"> $("#id_test_name").select2({ placeholder: "Search for an Item", minimumInputLength: 2, ajax: { url: "/resourse/?format=json&name=xyz", dataType: 'json', quietMillis: 100, data: function (term, page) { return { option: term }; }, results: function (data, page) { return { results: $.map

Angularjs and UI-Select: how to select an option from code

纵饮孤独 提交于 2019-12-07 06:02:46
问题 in angularjs i have a ui-select : <ui-select ng-model="itemSelected.selected" theme="selectize" ng-disabled="disabled"> <ui-select-match placeholder="Select an item...">{{$select.selected.Name}}</ui-select-match> <ui-select-choices repeat="item in itemsList"> <span ng-bind-html="item.Name"></span> </ui-select-choices> </ui-select> How can i select an item from code when i load the page? When i load the page in the controller i get the $scope.itemsList : how can i select a specific item from

Angularjs and UI-Select: how to select an option from code

与世无争的帅哥 提交于 2019-12-05 09:42:11
in angularjs i have a ui-select : <ui-select ng-model="itemSelected.selected" theme="selectize" ng-disabled="disabled"> <ui-select-match placeholder="Select an item...">{{$select.selected.Name}}</ui-select-match> <ui-select-choices repeat="item in itemsList"> <span ng-bind-html="item.Name"></span> </ui-select-choices> </ui-select> How can i select an item from code when i load the page? When i load the page in the controller i get the $scope.itemsList : how can i select a specific item from the controller ? Thanks You can set that on controller load itself Markup <body ng-controller="DemoCtrl"

ui select angularjs set maxlength for input value (ui select match)

混江龙づ霸主 提交于 2019-12-02 10:04:54
问题 I want an extra attribute just like "Placeholder" is passing from ui select match. I want to set maxlength of select input. I can set it through select.min.js adding attribute maxlength="" but i think making change to lib. file is not a solution. Just like i have adde maxlength="500" in input please help me around. Thanks 回答1: You can limit your collection using the angular's limitTo filter. Look at the limitTo reference. 回答2: As per my understanding, you are using ui-select with tagging (as

ui select angularjs set maxlength for input value (ui select match)

喜你入骨 提交于 2019-12-02 05:43:33
I want an extra attribute just like "Placeholder" is passing from ui select match. I want to set maxlength of select input. I can set it through select.min.js adding attribute maxlength="" but i think making change to lib. file is not a solution. Just like i have adde maxlength="500" in input please help me around. Thanks You can limit your collection using the angular's limitTo filter. Look at the limitTo reference. As per my understanding, you are using ui-select with tagging (as combo-box). in this to achieve your desired functionality: go to ui-select plugin.js and edit the template

ng-model is not getting changed in ui-select

时光毁灭记忆、已成空白 提交于 2019-12-01 15:47:33
I'm trying to achieve something very straightforward: <ui-select multiple ng-model="company.stack" theme="bootstrap"> <ui-select-match>{$$item.name$}</ui-select-match> <ui-select-choices repeat="technology in technologies | filter: $select.search"> <div ng-bind-html="technology.name | highlight: $select.search"></div> </ui-select-choices> </ui-select> When changing the objects, the changes are not reflected in the model company.stack. I tried changing it to $parent.company.stack, but it still doesn't work. What am I missing? I'm using AngularJS v1.3.0-beta.17. I had a similar issue with