Quantcast
Channel: Magnetism Solutions Dynamics CRM Blog : microsoft dynamics
Viewing all articles
Browse latest Browse all 651

Add or Remove Events for Sub-grids in Dynamics 365

$
0
0

In Dynamics 365, you can add or remove onload events from a sub-grid by referencing functions by name. The two examples below show how this is done.

Xrm.Page.getControl("mag_mygrid").addOnLoad(myMethod);
Xrm.Page.getControl("mag_mygrid").removeOnLoad(myMethod)


image


Because the addOnLoad and removeOnLoad functions only accept the event function name as a parameter, you cannot pass additional parameters to your function using this approach.

A workaround is to use anonymous functions instead.

Xrm.Page.getControl("mag_mygrid").addOnLoad(function(){ myMethod (parameter} });

The downside to this is that you cannot remove the anonymous function above as it does not have a function name.


Viewing all articles
Browse latest Browse all 651

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>