angularjs-select2

Angularjs ui-select (select2) not working with 'Controller as' syntax not getting selected ite

巧了我就是萌 提交于 2020-01-06 03:10:09
问题 I'm trying to get a select HTML control working with AngularJS ui-select which is located here on GitHub. For some reason, I am able to get the item selected when using $scope syntax, but not when I use the Controller As syntax. The plunker I am trying to get working with Controller as syntax is located here. I'm not sure what I am missing especially since the $scope syntax works perfectly. I'm not getting any errors to report. Here is a snippet from what is in plunker. Controller var app =

angular-ui-select2 and breezejs: load ajax list after typing in 2 characters

江枫思渺然 提交于 2020-01-02 11:44:07
问题 I have a project where I'm using BreezeJS to fetch data from my webserver. I'm using AngularJS with the ui-select2 module. Currently, I have it where when I load my page, breezejs makes a call to fetch the data that I dump into a scope variable. From there, select2 can easily make the reference to it and build accordingly. If I want to ajaxify things, it gets really tricky. I want to have the ability to use select2's ajax or query support, but instead of using it to fetch data, I want to use

Use AJAX in ng2-select2

随声附和 提交于 2019-12-24 10:57:19
问题 I have many drop-downs in my angular2js project. I am using ng2-select2 for these drop-down. In some dropdown, I need to filter and fetch data from an API as per the string user types into the select2 search box. The plug-in initializes but doesn't fire any AJAX. My code so far: HTML: <select2 [data]="options | async"></select2> Component: import { Component,OnInit } from '@angular/core'; import {Select2OptionData} from 'ng2-select2'; import {AlertService, LTJService} from '../../_services

How to use jQuery Select2 with AngularJS

南笙酒味 提交于 2019-12-19 19:40:54
问题 I am trying to use jQuery (2.2.1) Select2 (3.5.2) with Angularjs (1.5) but am having a difficult time grabbing the data from the select box. I have tried ui-select and I could retrieve data... but would often crash the browser when searching, was horribly slow and overall unstable (5000-10000 items). jQuery Select2 is fast and responsive, even with the large number of entries, but I cant seem to get the object when I select an option. <head> <script src="~/Scripts/angular.min.js"></script>

select2 dropdown selected value doesn't get updated with the updated model

会有一股神秘感。 提交于 2019-12-11 02:33:02
问题 I use the latest select2 api (select2-3.4.5) and my html for select 2 looks like this. <select ui-select2 id="select2-test" ng-model="mymodel.myTitle"> <option value="">Title</option> <option ng-repeat="title in nameList" value="{{title.key}}">{{title.name}}</option> </select> I am performing a save call in my controller which saves the model and reloads the saved model back. This is done inside the following block. $timeout(function(){ //if(!$scope.$$phase){ $scope.$apply(function(){ /

can we add textbox and button to select 2

落爺英雄遲暮 提交于 2019-12-09 23:11:13
问题 here i attached the code of select can we add the textbox and button into select2 elements. here which i used a code: <select style="width:100%" id="e9"> <option value="volvo">Suger</option> <option value="saab">Saab</option> <option value="opel">Opel</option> <option value="audi">Audi</option> </select> here i attached the output image how i really want: 回答1: here is the answer... $(".select2-drop").append('<div><input type="text" style="width: 86%;padding: 9px;"name="lname"><input class=

Remove select2 border on active of select element?

▼魔方 西西 提交于 2019-12-08 16:49:20
问题 I have gone through its css code but not able to find its actually property that is being applied on the main element. i'm making some changes in select2 library so that i can use it in my way. i trapped in its CSS did not get from which property border displayed on active or focus on element. Did not find any :active selector in css or I also checked it in js file not also there,while debugging not showing any css applied on that element. Link for plunkr image of element border. 回答1:

Angular ng-options in select2 - settings value property

旧巷老猫 提交于 2019-12-06 09:01:25
问题 I have an array of countries: var countriesList: [ {name: "Israel", code: "IL"}, {name: "India", code: "IN"}, {name: "Andorra", code: "AD"} ] and an array of selected countries: selectedCountries: [ { country:"IL" } ] I'm using select2 for selecting countries. I started with ng-repeat for generating the <options/> tag: <select id="countriesList" ui-select2 multiple ng-model='data.selectedCountries' data-placeholder='Choose or Search for Countries' name='locations' ng-change=

Angular ui-select placeholder not working when ng-model is initialized

两盒软妹~` 提交于 2019-12-01 08:15:24
I am trying to add a new select every time a button is clicked, The html: <div ng-repeat = "select in selects track by $index"> <ui-select ng-model="selects[$index]" theme="select2" ng-disabled="disabled" style="min-width: 300px;"> <ui-select-match placeholder="Select a person in the list or search his name/age...">{{$select.selected.name}}</ui-select-match> <ui-select-choices repeat="person in people"> <div ng-bind-html="person.name | highlight: $select.search"></div> </ui-select-choices> </ui-select> </div> <button ng-click="addNewSelect()"> Add new select</button> The controller: $scope

Angular ui-select placeholder not working when ng-model is initialized

自作多情 提交于 2019-12-01 07:10:22
问题 I am trying to add a new select every time a button is clicked, The html: <div ng-repeat = "select in selects track by $index"> <ui-select ng-model="selects[$index]" theme="select2" ng-disabled="disabled" style="min-width: 300px;"> <ui-select-match placeholder="Select a person in the list or search his name/age...">{{$select.selected.name}}</ui-select-match> <ui-select-choices repeat="person in people"> <div ng-bind-html="person.name | highlight: $select.search"></div> </ui-select-choices> <