We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

How i can set value in numeric textbox from angularJS?

Thread ID:

Created:

Updated:

Platform:

Replies:

120812 Oct 17,2015 08:34 AM Oct 19,2015 12:21 PM JavaScript 1
loading
Tags: ejDatePicker
Bharat Buddhadev
Asked On October 17, 2015 08:34 AM

Hello,

I am using web api for fetch data and bind data in form. so when i assign value in numeric textbox using e-value its working fine. but when data is coming from web api i am using below code for setting value in numeric textbox.

Javascript: 
$("#datePosition").ejNumericTextbox({ value: parseInt($scope.template.sections[0].dateTimeProperties.datePosition) });

CSHTML:
<input id="datePosition" ng-model="template.sections[0].dateTimeProperties.datePosition" type="text" class="form-control" ej-numerictextbox e-minvalue="1" e-maxvalue="999" />

above code is also working but i am getting error in console. i am attaching screenshot of console error stack.

so if is there any other way to set data in numeric textbox using angularjs?

Thanks
Bharat


Attachment: 20151017_1802NumericTextbox_bd826c13.7z

Francis Paul Antony Raj [Syncfusion]
Replied On October 19, 2015 12:21 PM

Hi Bharat,
Thanks for contacting Syncfusion support.
We have analyzed your query. We can set the data in numeric text box using e-value property. And you can also set the data by option (“property”, value) using corresponding object. For your reference we update the value after button click event occurs. Refer the following snippet to set the data in numeric textbox.

<input id="datePosition" ng-model=val type="text" class="form-control" ej-numerictextbox e-minvalue="min" e-value="val" e-maxvalue="max" />



<script type="text/javascript">


    angular.module('syncApp', ['ejangular'])

           .controller('Numericbox', function ($scope) {

               $scope.val = 100;

               $scope.min = 1;

               $scope.max = 999;

               $scope.funclick = function () {

                       // $scope.val = 400;

                       var x = $("#datePosition").data("ejNumericTextbox");

                       x.option("value", 400);

               }

           });

</script>



For your convenience, we have attached a sample. Please check the following link.

http://jsplayground.syncfusion.com/octhevdf

To know more about the list of properties, methods, and events available in dialog, please check the following link
http://help.syncfusion.com/js/api/ejtextboxes
To know more about getting started sample, please check the following link
http://help.syncfusion.com/js/numerictextbox/getting-started
Regards,
Francis Paul A


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;