Hi,
in database I have stored values like below
RSId RId CType Fromtable ValueCname DispalyCname Da
1 1 Dropdown Employee1 Id Name null
2 1 Dropdown Country Id Name1 null
3 1 Name null null null null
4 1 DOB null null null ToDay
After clicking of edit button it was displaying relevant values on form
probelm is that after clicking of edit button here by deafult fields are not disbaled based upon CType
1) i need to disable fields by default based upon CType
2) After clicking of edit button immediately i can scroll / focus to relevant form
I have updated code in below url
<button type="button" class="btn btn-info btn-sm" ng-click="Edit(report.RId)" readonly>Edit</button>
$scope.Edit = function (rId) {
$scope.form = true;
RId = rId;
//var id = $scope.employees[index].OrderId;
$.post("/report1/Edit/", { orderID: rId }, function (r) {
debugger;
RId= r.Orders.RId;
var id1 =RId;
$scope.Details = [];
for (var i = 0; i < r.Items.length; i++) {
var customer = {};
var itemId = r.Items[i].RSId;
customer.RId =r.Orders.RId;
customer.RSId = r.Items[i].RSId;
customer.CName = r.Items[i].CName;
customer.CType = r.Items[i].CType;
customer.FromTable = r.Items[i].FromTable;
customer.DisplayCName = r.Items[i].DisplayCName;
customer.ValueCName = r.Items[i].ValueCName;
if (r.Items.CName == "Dropdown") {
$scope.Details[i]["isDisabledDate"] = true;
$scope.Details[i]["isDisabledFromTable"] = false;
$scope.Details[i]["isDisabledDisplayCName"] = false;
$scope.Details[i]["isDisabledValueCName"] = false;
$scope.Details[i].Date = "";
}
customer.Date = r.Items[i].Date;
$scope.Details.push(customer);
}
});
}