vitalets / checklist-model

AngularJS directive for list of checkboxes
http://vitalets.github.io/checklist-model
MIT License
1.05k stars 207 forks source link

Checkbox not getting selected on click #129

Closed sauravGit closed 8 years ago

sauravGit commented 8 years ago

My HTML code :

Affiliate:
```


JS code in the controller : 

function globalPartnerFilterList()  // This method gets the data from the Server
      {
        var q = globalFilterQuery("AFFILIATE_DISPLAY_NAME.raw");
        esClientIndirect.search
        (
          {
            index: esIndex1,
            type: esType1,
            size: 0,
            body: q
          },
          function (error, response)
          {
            var data =  response.aggregations.column.buckets;
            var list = [];
            var i =0;
            for (var k in data)
            {
              element = data[k].key;
              list.push({id : i , name: element, filterBy : "AFFILIATE_DISPLAY_NAME.raw"})
              i= i+1;
            }
            $scope.affiliateDataInput =  list; // the list 
          });
      }
      $scope.affiliateDataOutput = {userinput: []};
      $scope.checkAllAffiliate = function()
      {
        $scope.affiliateDataOutput = angular.copy($scope.affiliateDataInput);
      };

Data Sample : 

{ filterBy: "column_name_1" , id : 0,  name: "Customer_1" }
{ filterBy: "column_name_2" , id : 1,  name: "Customer_2" }
{ filterBy: "column_name_3" , id : 2,  name: "Customer_3" }

When I click on Select All() or on check box model is not getting updated. Am I doing anything wrong?   
beradrian commented 8 years ago

Could you please prepare an example on plunkr, jsfiddle or anything similar? It would save some time, avoid confusion so that I can fix it faster, if needed. Thank you.

sauravGit commented 8 years ago

Sorry for the late response. I think now it's working. :+1: There was a conflict with other JS file.