jeudi 30 juin 2016

To delete multiple check boxes


I am able to delete only single checkbox at a time, but i need to delete multiple check boxes, below are my controller and html delete button div. controller app.controller('',function(){ $scope.delete = function(type) { //$scope.action = 'delete'; console.log(" inside..delete======="+type) var tab = deleteTab(type); console.log("tab is------------>"+tab); var node = $('#'+tab).find("input[type=checkbox]:checked").eq(0); console.log('node.length'+ node.length) if(node.length){ node = $('#'+tab).find("input[type=checkbox]:checked").eq(0).parents("tr").find("td"); var id = $('#'+tab).find("input[type=checkbox]:checked").eq(0).parents("tr").data("id"); console.log(" inside..delete"+id) myService.delete({action:'delete',type:type, id:id},function() { console.log(" inside.2.delete"); if(id !==undefined){ console.log("please uncheck it..."); $("#"+tab+id).prop("checked", false); //alert(tab.split("#")[1]); $scope.enable_disable(tab); } $scope.get(type); $scope.getMapping(); }); } $scope.flag = true; }; }); template <button id="deleteme1" class="btn btn-primary btn-xs" data-title="Edit" data-toggle="modal" data-target="#" ng-click="deleteOrg('organization')" disabled> <span class="glyphicon glyphicon-trash"></span> </button>

Aucun commentaire:

Enregistrer un commentaire