[CLOSED] [Razor] Row expander + multiple direct events

  1. #1

    [CLOSED] [Razor] Row expander + multiple direct events

    Hi there,

    I have a grid panel with row expander that has 2 grids within it that I want to populate via ajax methods that call the controller before expand. I've got it working with a single grid like shown:
    .DirectEvents(rowExp =>
                            {
                                rowExp.BeforeExpand.ExtraParams.Add(new Parameter("ProductInstanceId", "record.data['ProductInstanceId']", ParameterMode.Raw));
                                rowExp.BeforeExpand.Url = "/Products/ExpandServices";
                                rowExp.BeforeExpand.Success = "#{childServiceStore}.loadData(result.data);";                          
                            })
    How can I got about populating the 2nd grid? all my attempts/experiments end with a "Only one item is allowed in this Collection." exception
    Last edited by geoffrey.mcgill; Jun 21, 2012 at 4:22 AM. Reason: [CLOSED]
  2. #2
    I've got around the initial exception by putting both gridpanels within a containing panel but now I find only one beforeexpand direct event will fire
  3. #3
    Hi,

    Quote Originally Posted by machinableed View Post
    I've got around the initial exception by putting both gridpanels within a containing panel but now I find only one beforeexpand direct event will fire
    Do you expect the BeforeExpand should be fired twice? Why?

    I think one RowExpander - one BeforeExpand. Generally, RowExpander knows nothing about its content - there is a single GridPanel or two GridPanels or something else.

    Or, maybe, am I misunderstanding something?
  4. #4
    i don't expect it to fire twice, i'm just wondering if there is a way I can effectively do the same thing either in parallel or sequentially... my problem is that when i expand the row I want to populate 2 grids (via 2 stores)... basically when i expand the row I want to do what i'm doing in the first post to populate the first grid but then I'm unsure how to populate the 2nd grid at the same time (which is set up in a similar way to the first but has a different store and calls a different controller method).
  5. #5
    Could you clarify why you can't populate the grids at the same time?

    What are the Stores configurations?

    For example, you could set up some Proxies for the Stores and call
    Store1.load();
    Store2.load();
    within the BeforeExpand listener.
  6. #6
    Okay - I've sorted my problem out by using direct methods instead of a direct event - thanks for your help

Similar Threads

  1. Direct Events with Razor
    By gdog_5021 in forum 2.x Help
    Replies: 3
    Last Post: Aug 15, 2012, 10:46 AM
  2. [CLOSED] How to Call an event by Direct Events
    By Oliver in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Jun 12, 2012, 6:33 PM
  3. Direct Events dynamic Url
    By Tallmaris in forum 1.x Help
    Replies: 1
    Last Post: Aug 18, 2011, 1:26 PM
  4. Calendar - EventEditForm - Direct Events
    By vwagoner in forum 1.x Help
    Replies: 4
    Last Post: Jun 17, 2011, 5:27 PM
  5. [CLOSED] Direct events in user control
    By tiramisu in forum 1.x Legacy Premium Help
    Replies: 8
    Last Post: Dec 13, 2010, 11:34 AM

Posting Permissions