Hello Sir
i hava a drop down and i bind that value on ng-change event value is coming from database and bind it on dropdown but some time its bind and some time not bind again
if i refrsh then it bind but again if i change drop down vale then it will not bind please help.
@page
@{
ViewData["Title"] = "SalesDetailallocate";
Layout = "~/Pages/Shared/_Layout.cshtml";
}
<h2>Sales Unit Allocation</h2>
<div ng-controller="CtrlSalesDetailallocate">
<div class="row">
<div class="col-xs-12 col-sm-12">
<div class="widget-box">
<div class="widget-body">
<div class="widget-main">
<div class="row">
<div class="col-xs-12 col-sm-4">
<label for="ddlState">State<span class="required red">*</span></label>
<select class="col-xs-12" style="height:34px" id="ddlState" ng-change="OnStateChange()" ng-model="StateID" ng-init="StateID=0">
<option value="0">--Select State--</option>
<option ng-repeat="x in DTState" value="{{x.StateID}}">{{x.StateName }}</option>
</select>
</div>
<div class="col-xs-12 col-sm-4">
<label for="ddlDistrict">District<span class="required red">*</span></label>
<select class="col-xs-12" style="height:34px" id="ddlDistrict" ng-change="OnDistictChange()" ng-model="DisttID" ng-init="DisttID=0">
<option value="0">--Select Distinct--</option>
<option ng-repeat="x in DTDistt" value="{{x.DisttID}}">{{x.DisttName }}</option>
</select>
</div>
<div class="col-xs-12 col-sm-4">
<label for="ddldealer">Dealer<span class="required red">*</span></label>
<select class="col-xs-12" style="height:34px" id="ddldealer" ng-model="DealerCode" ng-change="OnDealerChange();" ng-init="DealerCode=0">
<option value="0">--Select Dealer--</option>
<option ng-repeat="x in DTDealer" value="{{x.DealerCode}}">{{x.DealershipName}}</option>
</select>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
$scope.OnDealerChange = function () {
for (var i = 0; i < $scope.DTDealerTehsil.length; i++) {
//if (!$scope.tehsilchecked[i].selected) {
$scope.tehsilchecked[i] = false;
//}
};
$('#ddlsalesunit').val(0);
}