[CLOSED] TreeView ItemMove DirectEvent not triggering when ExtraParams are defined.

  1. #1

    [CLOSED] TreeView ItemMove DirectEvent not triggering when ExtraParams are defined.

    Problem Description:

    I'm trying to code Drag&Drop functionality on a TreePanel. As expected, I'm trying to trigger a controller method to handle the change in the database.

    When ExtraParams are defined for the DirectEvent, the controller method is not called. I've checked the traffic and it doesn't send any request to the server. I haven't had time to inspect the sequence of events client-side.

    How to reproduce the issue:

    1) Define any TreePanel (like the ones in the examples). In my case, I'm defining the view in C# code.

    2) Add the TreeViewDragDrop plugin:

    this.View.Add(new TreeView()
                {
                    Plugins =
                    {
                        new TreeViewDragDrop()
                        {
                            ContainerScroll = true,
                            AllowLeafDrop = true,
                        }
                    }
                });
    3) Setup the DirectEvent

    this.DirectEvents.ItemMove.Action = "MoveNode";
    this.DirectEvents.ItemMove.ExtraParams.Add(ViewModelHelpers.CreateParameter("item", "item", ParameterMode.Raw));
    this.DirectEvents.ItemMove.ExtraParams.Add(ViewModelHelpers.CreateParameter("oldParent", "oldParent", ParameterMode.Raw));
    this.DirectEvents.ItemMove.ExtraParams.Add(ViewModelHelpers.CreateParameter("newParent", "newParent", ParameterMode.Raw));
    4) Setup the controller method

    public ActionResult MoveNode(string item, string oldParent, string newParent)
            {
    
                //Do something here ...
    
                return this.Direct();
            }
    If I set a breakpoint on this controller, it's never reached and as I said before, no request is being sent from the browser.

    Any idea of what might be happening is appreciated.

    Cheers,

    Carlos
    Last edited by Daniil; Jan 16, 2014 at 5:13 AM. Reason: [CLOSED]
  2. #2
    Hi Carlos,

    "item", "oldParent" and "newParent" are a Node instances.
    http://docs.sencha.com/extjs/4.2.1/#....NodeInterface

    All of them are too complex objects with cross-references


    . Then you cannot be serialized to strings and be sent to a server.

    You should retrieve and pass simple things. For example, an id of moved node.
    item.getId()
  3. #3

    Problem Solved

    Hi Daniil,

    Thank you for your prompt response. As usual, it's all sorted. I should pay more attention when reading the documentation.

    Cheers,

    Carlos

Similar Threads

  1. [CLOSED] DirectEvent: passing via extraparams html content of a panel
    By tanky65 in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Mar 02, 2013, 4:25 PM
  2. Replies: 0
    Last Post: Jul 27, 2012, 7:54 PM
  3. Replies: 3
    Last Post: Mar 14, 2012, 1:35 PM
  4. [CLOSED] [1.0] ExtraParams with DirectEvent when IsUpload="true"
    By rcaunt in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: May 06, 2010, 6:35 PM
  5. [CLOSED] [1.0] GridPanel DirectEvent ExtraParams
    By jhouser in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Jan 07, 2010, 10:12 AM

Tags for this Thread

Posting Permissions