Hi I am trying to reset a numeric textbox back to the original value when invalid input is detected (deleting all the contents of the field causes the field to remain empty instead of reverting back to the default)
The main problem is that it is not re-rendering when the $scope.intervallength value changes is there a way of resetting the textbox when the contents are not a number?
<input id="IntervalLengthSpinner" type="text" ej-numerictextbox e-value="intervalLength" e-focusout="focusOut" e-minvalue="1" e-maxvalue="10000" />
Inside the controller I am using the following:
$scope.intervalLength = 1;
$scope.focusOut = function (args) {
if (!angular.isNumber(args.value)) {
console.log("invalid entered");
$scope.$apply(function () {
$scope.intervalLength = 1;
});
//$scope.intervalLength = 1;
// var y = $("#" + args.model.name + "~ .e-select").find(".e-spin.e-spin-up");
// y[0].click();
//var u = y.find(".e-spin.e-spin-up");
//$("#" + args.model.name[0]).find("e-spin e-spin-up")[0].click();
//var t = $("#" + args.model.name);
//$scope.$apply(function() {
// $("#" + args.model.name).prop({ "aria-valuenow": 1 });
//});
//args.value=$scope.intervalLength;
// $scope.$apply();
}
else {
$scope.intervalLength = args.value;
console.log("valid");
console.log($scope.intervalLength);
}
};