[CLOSED] Direct Method - App.direct undefined

  1. #1

    [CLOSED] Direct Method - App.direct undefined

    Hi all

    I thought that defining a Direct method would be as easy as: decorate a controller with [DirectController], decorate an action with [DirectMethod], define a handler as "App.direct.MyMethodname()"

    Every time I do this I get the error in the browser saying that the App.direct is undefined. What am I missing here please?

    Defining a double click for a GridPanel row (I am not sure if this is the right way to do this!)

    [DirectController]
        public class Checkbox_SelectionController : Controller
        {
            public ActionResult Index()
            {
                return View(new Checkbox_SelectionModel());
            }
    
            [DirectMethod]
            public ActionResult DblClick()
            {
                return this.Direct();
            }
        }
    .Listeners(l =>
                    {
                        l.ItemDblClick.Handler = "App.direct.DblClick();";
                    })
    Thank you
    Last edited by Daniil; Jul 23, 2014 at 1:51 PM. Reason: [CLOSED]
  2. #2
    Hi @registrator,

    Do you use Areas? If yes, please read this thread.
    http://forums.ext.net/showthread.php?36771
  3. #3
    I do, yes. Actually, I am doing this on your MVC examples.
    I have added
    [DirectController(AreaName = "GridPanel_Selection_Models")]
    And now the error is different:

    Uncaught TypeError: undefined is not a function
    This is very easy to replicate on your MVC examples. Area GridPanel_Selection_Models, add to the GridPanel in the Checkbox_Selection folder

    .Listeners(l =>
                    {
                        l.ItemDblClick.Handler = "App.direct.DblClick();";
                    })
    Add this to the controller:

    [DirectMethod]
            public ActionResult DblClick()
            {
                return this.Direct();
            }
    Should be very simple.

    Thank you
  4. #4
    I think you should use:
    App.direct.GridPanel_Selection_Models.DblClick();
  5. #5
    That's it. Thank you.

Similar Threads

  1. App.direct undefined
    By ingbabic in forum 2.x Help
    Replies: 10
    Last Post: Jun 10, 2014, 3:33 PM
  2. Replies: 2
    Last Post: May 13, 2014, 8:52 AM
  3. [CLOSED] App.direct is undefined
    By jesperhp in forum 2.x Legacy Premium Help
    Replies: 9
    Last Post: Dec 04, 2013, 12:53 PM
  4. [CLOSED] Output Cache issue with Direct Method / Direct Event
    By amitpareek in forum 1.x Legacy Premium Help
    Replies: 18
    Last Post: Mar 01, 2013, 5:03 AM
  5. Direct method and direct event over SSL?
    By dimitar in forum 1.x Help
    Replies: 0
    Last Post: Oct 08, 2011, 8:09 PM

Posting Permissions