locked
Using CRM subgrid from javascript RRS feed

  • Question

  • Hello
    I am trying to use the CRM subgrids to implement a master-detail scenario.
    i.e. on selection of a record in the master grid, the detail grid would load related child records.
    Is it possible to do any of the following:
    a) Subscribe to some event that fires when the grid is loaded and ready since the grid loads asynchronously.
    b) Limit row selection to a single row
    c) Subscribe to some event that fires whenever a row is selected
       I have tried subscribing to the add_onSelectionChange but this does not seem to fire when a row is selected

    I am  using document.getElementById to get a handle on the grid since this is the only way to get to the methods/events
    that the grid exposes.
    Using Xrm.Page.getcontrol gets a reference to the control but does not expose the methods/events needed to work with the
    grid.

    Also another approach that I am attempting is to create a HTML web resource containing 2 iframes and setting the src of the
    master grid to an associated view. This does load the IFrame as intended but I am unable to get a handle on the grid contained in the Iframe since I don't know the ID. Is this at all possible?

    Any help/guidance would be much appreciated.

    Thanks.
    Abhijeet


    -Abhijeet

    Friday, July 19, 2013 4:26 AM

Answers

  • Hi,

    I really don't think that using the standard grids is the right way to approach this. The grids are note designed to be manipulated in this way and your code will certainly not upgrade to later rollups/Dynamics CRM 2013.

    A HTML webresource is a much better approach, but rather than use IFRAMES, use HTML to build the grids. There is a contact editor grid example in the SDK or you could look at Sparkle XRM. Sparkle XRM is still in pre-release, but is open source and you would be a welcome contributor. The bulk delete scheduler example has code to show dependant grids.

    hth


    Scott Durow
    Blog www.develop1.net    Follow Me
    Rockstar365
    If this post answers your question, please click "Mark As Answer" on the post and "Mark as Helpful"

    • Marked as answer by Abhijeet P Wednesday, July 31, 2013 5:36 AM
    Friday, July 19, 2013 8:10 AM
    Answerer