Click here to Skip to main content
15,887,350 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello frnds,

I am facing problem when I am going to bind ng-grid on dropdown selected index change.
I think page is not reload after drop down selected index change.

Controller code :-
JavaScript
$scope.GetUserDetailsByCompany = function (item) {
    var params = { companyId: item.CompanyID };
    $http.get("UserCriteria/GetUserDetailsByCompany", { params: params }).success(function (data) {
        $scope.userData = data.UsersData;
        $scope.gridOptions = { data: 'userData' };
    });
}


HTML
<select ng-model="ddlCompany" class="form-control" ng-options="c.CompanyName for c in CompanyData track by c.CompanyID" ng-change="GetUserDetailsByCompany(ddlCompany)">                       
 
<div class="gridStyle" ng-grid="gridOptions">            
</div>


What I have tried:

I tried data bind to ng-grid on page load, its working fine.
but on dropdown change its not working.
Posted
Comments
Andy Lanng 31-Aug-16 11:38am    
any changes to $scope objects should cause the redraw.
to double check, perform a $scope.$apply(). It should error saying that it's already in progress. That should prove that the redraw has occurred.

There may be a mistake in how you're setting the grid data, but I must confess that I've not used ng-grid. It would take long for me to play with if you need further help, tho
rameshvar 1-Sep-16 0:58am    
Ok Thanks

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900