[CLOSED] More explaination on one of your examples

  1. #1

    [CLOSED] More explaination on one of your examples

    I was hoping to get some clarification on one of the example pages in the MVC example explorer: http://mvc.ext.net/#/Portal/Complex/

    On the page, there are several different controls binding to data when the page loads. The "Employees" grid has a store that uses a proxy to call "GetPersons", which I assume calls the below code in the controller.
    
    public ActionResult GetPersons()
    {
        return this.Direct(Data.GetAllPersons());
    }
    I am not immediately able to implement the same pattern as am not presented with the "Direct(" method in my controller. The only "using" in the example source code is for System.Web.Mvc - which I also have included in my controller.

    Can you provide a little more detail on what is happening in that example that lets you have multiple controls each calling their own individual actions to load data when the page loads?
    Last edited by geoffrey.mcgill; Feb 22, 2013 at 7:42 PM. Reason: [CLOSED]
  2. #2
    Quote Originally Posted by jpadgett View Post
    Can you provide a little more detail on what is happening in that example that lets you have multiple controls each calling their own individual actions to load data when the page loads?
    I believe the magic happens with following config:

    .Url(Url.Action("GetPersons"))
    You point the .Url of the DirectEvent to the Action of the Controller. The url can be a string, or a Url.Action.

    Hope this helps.
    Geoffrey McGill
    Founder
  3. #3
    But how does this work?

    Quote Originally Posted by jpadgett View Post
        return this.Direct(Data.GetAllPersons());
    I do not have a method called "Direct" in my controller. I can assume what the Data class is, and what it might be doing - but I have not been able to figure out exactly what that Direct method is doing.
  4. #4
    Hello!

    this.Direct() is special method to return result script from DirectEvent execution in ASP.NET MVC. In this case it return JSON data from DirectEvent.
  5. #5
    Gotcha. Found it in the example source code.

Similar Threads

  1. [CLOSED] Simple Tasks - example explaination
    By echodev in forum 2.x Legacy Premium Help
    Replies: 6
    Last Post: Feb 15, 2013, 4:10 AM
  2. [CLOSED] TabBar Config examples in Examples Explorer not working
    By anup in forum 2.x Legacy Premium Help
    Replies: 3
    Last Post: Jun 26, 2012, 9:32 AM
  3. Replies: 7
    Last Post: Mar 22, 2012, 1:00 PM
  4. examples @ examples.ext.net giving error
    By Amar in forum 1.x Help
    Replies: 2
    Last Post: Jun 08, 2010, 4:18 AM
  5. Examples
    By Timothy in forum Open Discussions
    Replies: 1
    Last Post: Nov 11, 2008, 10:54 PM

Posting Permissions