0

I want to run a JS on a subgrid upon OnChange event of another field on the form.
To my understanding the best method is to cause focus on the subgrid prior to launching the JS on the subgrid.
So my inquiry is, what is the correct piece of script to focus to a specific subgrid?

P.S. I'm using Dynamics CRM 2011 RU17

Thanx :)

pnuts
  • 58,317
  • 11
  • 87
  • 139
Avsrot
  • 33
  • 5

1 Answers1

0

You do not need to set focus on a subgrid before running javascript on the grid. All you need to do is refresh the subgrid after you have made the change.

For example:

var myGridControl = Xrm.Page.getControl('myGrid');

//Do something to myGridControl

myGridControl.refresh();

http://crmdm.blogspot.com/2011/12/how-to-refresh-sub-grid-in-crm-2011.html

Zach Mast
  • 1,698
  • 1
  • 10
  • 17
  • 1
    Just remember to access using the Xrm – Sxntk Jan 15 '15 at 19:04
  • Sorry folks, but I may have not been clear enough about my issue. What I actually really need is to click a button (a self customized button) on subgrid "A", which should trigger a JS on subgrid "B". Therefore I got to FIRST switch focus to subgrid "B" in order to capture the "selectControl" parameters of subgrid "B". Only then I can run my desired JS on subgrid "B". – Avsrot Jan 17 '15 at 22:13
  • You mean click a button on the ribbon subgrid area of "A" and then focus the subgrid "B". I follow you until this, what do you need to do exactly? – Sxntk Jan 26 '15 at 18:29