Search Posts

Category: ui-select

how to use id of object instead of whole object in ng-model of ui-select

how to how to use id of object instead of whole object in ng-model of ui-select Using ui-select, I have list of personels and want to show that in with ui-select by this way: (function() { ‘use strict’; angular .module(‘framework’) .controller(‘UserDetailController’, UserDetailController); function UserDetailController(BasePersonel) { var vm = this; vm.basePersonels = BasePersonel.all(); } })(); <ui-select ng-model=”vm.basePersonelId” > <ui-select-match> <span ng-bind=”$select.selected.entityTitle”></span> </ui-select-match> <ui-select-choices repeat=”item in (vm.basePersonels | filter: $select.search) track by item.id”> <span ng-bind=”item.entityTitle”></span> </ui-select-choices> </ui-select> […]

ui-select tagging if + function name

I have a dropdown using UI-select. I am using the tagging correctly, but I want that the tagging will work only if “isGuest == true”. I understand that the tagging is a “true-false” question, but also sends to the add item function. how do I work with both of them in the same part? <ui-select ng-model=”request.project” theme=”bootstrap” tagging-label=”false” tagging=”addProject”> <ui-select-match placeholder=”— Select project —“>{{$select.selected.name}}</ui-select-match> <ui-select-choices repeat=”project in testRelated.projects”> <div ng-bind-html=”project.name”></div> </ui-select-choices> </ui-select> ——————————————– $scope.addProject = […]

Accessing AngularJS UI-Select selected value

Currently i have multiple dropdown directives that share the same array of dropdown values. When I make a selection, it’ll update the rest of the dropdown selected value as well how do I go about having a unique selection for the rest of my dropdowns. My current work around would be setting ng-model=”ctrl.ngModel” however I will not be able to access the dropdown selected value. dropdown.html <div> <ui-select name=” ng-model=”ctrl.ngModel.selected” theme=”bootstrap” class=’expiry admin-expiry’ append-to-body=’true’ reset-search-input=’true’ […]

AngularJS ui-select multiple default choice

I’ve a problem with ui-select multiple. I need to set default value but I can’t do it. I’m using a custom component of ui-select: <input-form-wrapper input-ctrl=”$ctrl”> <ui-select ng-if=”$ctrl.isMultiple” skip-focusser=”true” ng-model=”$ctrl.uiSelectValue” multiple id=”{{$ctrl.name}}” name=”{{$ctrl.name}}” ng-change=”$ctrl.onChange()” ng-disabled=”$ctrl.isDisabled” theme=”bootstrap”> <ui-select-match placeholder=”{{$ctrl.placeholder}}”> {{($ctrl.shortMatchElement === ‘true’) ? $item.code : $item.uiSelectDisplayField}} </ui-select-match> <ui-select-choices ui-disable-choice=”option.status == ‘disabled'” repeat=”option as option in $ctrl.options | filter: {uiSelectDisplayField: $select.search}”> <div ng-bind-html=”option.uiSelectDisplayField”></div> </ui-select-choices> </ui-select> </input-form-wrapper> I’m using it in this way: <my-ui-select json-options=”$ctrl.myModelList” is-disabled=”$ctrl.myModelDisabled” ng-model=”$ctrl.myModel” value-field=”item” […]

Get in selected the key and value in repeat (UI Select)

I have this entity public class UbicacionGeografica : BaseEntity { public virtual int Ejercicio { get; set; } public virtual int CodigoUbicacionGeografica { get; set;} public virtual string DescripcionLarga { get; set; } public virtual string DescripcionCorta { get; set; } public string Descripcion { get { return this.CodigoUbicacionGeografica + ” – ” + this.DescripcionLarga; } } } and this <ui-select ng-model=”ubicacionGeograficaSelected.Selected” multiple theme=”selectize”> <ui-select-match placeholder=”Elige una o más ubicaciones geograficas.”>{{$item.codigoUbicacionGeografica}}</ui-select-match> <ui-select-choices repeat=”item.codigoUbicacionGeografica as item […]

Make ui-select as required field

ng-required=”true” and only required tags or not working with ui-select, this is a long standing bug and I think it is not solved yet. %ui-select(ng-model=”obj.prop” required) %ui-select(ng-model=”obj.prop” ng-required=”true”) above lines don’t work.These lines should workd like %input.form-control(ng-model=”obj.prop” ng-required=”true” type=”text”) I want to make ui-select as required field, If this is really a bug then is there an alternate way ?? These lines let the form to be submit even nothing is selected and don’t make […]

UI Select Match value for binding when performing UPDATE

I am trying to make an UPDATE window. If I bring the data with $scope.project_data, it works for the INPUT TYPE=”TEXT”. But, not for the UI-Select. I think I have to make some changes to UI-SELECT-MATCH. But, I am not sure how to bind the SQL data to UI-SELECT-MATCH on the instance when the window is brought up. [HTML] <!– This works. –> <input type = “text” class = “form-control” ng-model = “project_data.project_title” id = […]

can’t import ui-select in angularjs and ES6

I’m trying to import ui-select in my js file using yarn and webpack than import it in my module as follow. import ngSanitize from ‘angular-sanitize’; import uiselect from ‘ui-select’; import ‘ui-select/dist/select.css’; export default angular.module(‘app.module’, [ /** … **/ ngSanitize, ‘ui.select’ /** … **/ ]) but When I check my generated css file I can see that the CSS was correctly imported however not the js.(there is no issue on my webpack config as I can […]

angular ui-select2 not set value in edit mode

<select id=”e1″ style=”width:100%” ui-select2 tabindex=”-1″ ng-init=”GetAllAgent()” ng-model=”Agent” ng-options=”ctr as ctr.AgentName for ctr in ListAgent track by ctr.AgentId” ng-change=”GetSubAgentList(Agent.AgentId)”> <option value=””> </option></select> when it is in edit mode,could not set the default value using the below code angular.forEach($scope.ListAgent, function (value, index) { if (value.AgentId == HR.AgentId) { $scope.Agent = $scope.ListAgent[index]; } }) $scope.ListAgent= [{ AgentId: “0”, AgentName:”Ann” }, { AgentId: “1”, AgentName:”Muh” }]; and HR.AgentId=1 Source: AngularJS

UI-SELECT binding to controller.js in Array?

First of all, thank you for your reading. I am new to the language. I am trying to use UI-SELECT and bind the data to controller.js to save into database. I know that UI-SELECT should be used with ng-model in “A.selected” way. I searched for some help but couldn’t find how to make the below code in array style to work. [HTML with UI-Select] <ui-select ng-model = “project_customer_company.selected” theme=”bootstrap”> <ui-select-match placeholder=””> {{$select.selected.customer_company_name}}</ui-select-match> <ui-select-choices repeat=”customer in […]

Next Page »