Search Posts

Category: checkbox

Tracking the checkbox status and use multiple data for ng-model

I have a situation here. I have two checkboxes. <span class=”flex-3″><input type=”checkbox” ng-model=”station.val.fingerprint_scanner” ng-click=”updateAccessMode(station.key,’fingerprint_scanner’, station.config_group)” /></span> <span class=”flex-3″><input type=”checkbox” ng-model=”station.val.id_card” ng-click=”updateAccessMode(station.key,’card_scanner’, station.config_group)” /></span> station.val.fingerprint_scanner and station.val.id_card are the values I am getting from database. And depending on the station.val.fingerprint_scanner and station.val.id_card the checkbox are checked and unchecked. Now since I have already assigned ng-model. How can I get the value of station.val.fingerprint_scanner and station.val.id_card if a user has made any changes. Depending on the current […]

Handling 1000s of checkboxes created dynamically

I created a form with angularjs and HTML in which 1000 of checkboxes are created dynamically. When the no of checkbox is low select all and deselect all checkbox work fine but when the no. increased 200+ it start to show lag, even if I click single checkbox. Any Solution Select all code angular.forEach($scope.xy, function(value,key){ $scope.xy[key] = true; }) </pre> Source: AngularJS

How to refresh radio button in list user (table)

When I click the radio button, the popup display detail user A correct, but when I click in radio of line 2 (userB), the popup display details of user A (also details userA and no detail for userB). How do I resolve this issue to refresh the radio button My HTML: <tbody> <tr ng-repeat=”nm in listeOfUsers |filter:searchFish “> <td> <input type=”radio” name=”checked” ng-checked=”nm.checked” ng-change=”changeVal()” value=”{{nm.Id}}” ng-model=”nm.checked” ng-click=”resetAll(nm)”/> </td> <td> {{nm.nom}} </td> <td> {{nm.prenom}} </td> <td> […]

How to put alert before check-uncheck a kendo checkbox

So if a user wants to check a checkbox, it will prompt a dialog if he/she have rights to tick-untick. So when he don’t have rights, the state will stay the same. I am using angularjs with kendo treeview. $scope.options = { checkboxes: { checkChildren: true, }, loadOnDemand: false, check: onCheck, dataSource: $scope.treeData, template: ‘{{ dataItem.text}}’, schema: { model: { children: “List” } } function onCheck(e) { var currentItem = e.sender.dataItem(e.node); console.log(currentItem.rights); //if currentItem.rights= ‘0001’ […]

Angular checkbox with ng-change very slow to render

I’m using Angular 1.5.8 and have a ng-repeat as: <div class=”row table-row float” ng-repeat=”float in floats | orderBy: [‘Name’, ‘Location.Name’] track by float.Id” style=”{{setColour(float.LocationType)}}”> I’ve added a checkbox as per: <input type=”checkbox” class=”checkbox” ng-change=”toggleFloat(float.Id)” ng-model=”float.Selected”/> In my controller I have: $scope.toggleFloat = function (Id) { // var float = _.find($scope.floats, // function(f) { // return f.Id === Id // }); // // float.Selected = !float.Selected; console.log(“float: “, Id) // $scope.selectMe2($scope.floats[index]) // $scope.selectMe() } Note that […]

set max value of input box based on the selected checkbox in angular js

I have created a table which displays units, amounts , checkbox1forunits , checkbox2foramounts , input. the table has four records. the value of units and amounts come from the json array. I want to set the max of input box based on the selected checkbox. for each input box there is different max value. if checkbox1forunits is selected then set max of input box to the corresponding given unit. if checkbox2foramounts is selected then set […]

How to make a function call with ng-checked : Angularjs

I need to display data when i checked on a checkbox(for example when i clicked on multiple checkbox i should get the data regarding all checkbox value)for this i have tried ng-checked and call the functions inside this directive but when i have write this in my code a very ridiculous thing happened with me,my system is getting i have wrote ng-change for showing my code. <div class=”checkbox checkbox-warning”> <input type=”checkbox” ng-model= “fields” value=”{{}}” […]

How to give default or initial selection for md-checkbox where its data comes from JSON

I have a list of <md-checkbox> where it is repeated using JSON array. I want to give an initial selection for 2 checkboxes. Please help me on this. My js code: $scope.elecselected = []; $scope.toggle = function (elecitem, eleclist) { var idx = eleclist.indexOf(elecitem); if (idx > -1) { eleclist.splice(idx, 1); } else { eleclist.push(elecitem); } console.log(“item:”+elecitem+ ” List:”+ eleclist); }; $scope.exists = function (elecitem, eleclist) { return eleclist.indexOf(elecitem) > -1; }; $scope.electrical = [{“ID”:”161″,”Value”:”ABC”,”Name”:”AAAA […]

AngularJs – Select checkboxes by binding list of selected objects to list of all objects

I have searched for a solution to my problem but have not been able to find the right answer. I have a list of all questions and a list of selected questions. I need to build a list of checkboxes from the list of all questions and check the ones that are in the list of selected questions. When changes are made to the checkboxes, I need the list of selected questions to be updated […]

Next Page »