- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2022 07:05 AM
Hi Team,
I have one question regarding $scope.$on question in widgets.
I see the function $scope.$on("field.change", function(evt, parms) { ... } is called only when the record picker is changed within the same widget.
Is it possible to invoke this function for other fields?
If not how can we trigger similar functionality for other fields?
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2022 09:17 AM
I think in this case it wont work for text field
If you want to get the changes on text field or the value entered in the text field use ng-change directive in html code in input tag which is already there in your code and catch it in client side using ng-change function like below
<input type="text" ng-model='c.data.desc' id="description" class="form-control" ng-change="checkdescVal(c.data.desc)" required/>
// this is your text code
Write below code in your client controller
client controller:
$scope.checkdescVal = function(desc) // catch the parameter which contains changed text
{
alert(desc);
}
please try this and let me know
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2022 09:17 AM
I think in this case it wont work for text field
If you want to get the changes on text field or the value entered in the text field use ng-change directive in html code in input tag which is already there in your code and catch it in client side using ng-change function like below
<input type="text" ng-model='c.data.desc' id="description" class="form-control" ng-change="checkdescVal(c.data.desc)" required/>
// this is your text code
Write below code in your client controller
client controller:
$scope.checkdescVal = function(desc) // catch the parameter which contains changed text
{
alert(desc);
}
please try this and let me know
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2022 11:58 PM
Hi Mohit
Thanks for confirming that the $scope.$on does not work for text field.
I was able to achieve it by calling the client side.
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2023 08:59 AM
Hi Mohith,
I have written a custom widget that creates a bar chart. I am using angular-chartjs libraries. Although the bar chart renders fine, I am not able to fetch the chart instance. The code from the documentation in the following link and what I am trying in the widget controller is as follows:
$scope.$on('chart-create', function (evt, chart) { console.log(chart); });
https://github.com/jtblin/angular-chart.js
No compile error but not able to see the chart-create event being called.
Can you suggest whats wrong here.