[CLOSED] How to use StoreFor Model

  1. #1

    [CLOSED] How to use StoreFor Model

    Hi,

    I try to use StoreForModel like your examples in the Ext.Net.MVC.Examples project.
    In your models, there is these lines of code:
    [Proxy(Read="~/Models/StoreFor/GetEmployees")]
        [JsonReader(Root = "data")]
        [VirtualModelField(Name="FullName", ConvertHandler="fullNameBuilder")]
        [ClientResource(Path="~/Areas/Models/Content/storeHelpers.js")]
    So, when I use Html.X().StoreFor<Ext.Net.MVC.Examples.Areas.Model s.Employee>() in the View, the data is loaded from StoreForControllers/GetEmployees.

    In my case, I want to load data dynamically with parameters. How can I set Proxy in the View, and how can I pass the parameter?
    For other attribute like VirtualModelField, ClientResource, how can I use in the View?

    Thanks in advance.
    Last edited by Daniil; Oct 22, 2012 at 1:15 PM. Reason: [CLOSED]
  2. #2
    Hi @UnifyEducation,

    If you just need to define a Proxy for the Store, then it can be done in a common way.
    .StoreFor(...).Proxy(...)
  3. #3
    Quote Originally Posted by Daniil View Post
    Hi @UnifyEducation,

    If you just need to define a Proxy for the Store, then it can be done in a common way.
    .StoreFor(...).Proxy(...)
    Can You Clarify That For Me? I use this code but it does not work
    Html.X().StoreFor<TeacherAddress>()
                                        .Proxy(p => p.Add(new DirectProxy
                                            {
                                                Url = Url.Action("GetAddresses"),
                                                ExtraParams = { new Parameter("resource_id", resource_id) },
                                                AppendAction = true,
                                                AutoDataBind = true
                                            }))
  4. #4
    I think you should use an AjaxProxy instead of DirectProxy.

Similar Threads

  1. does not recognize the tag <model>
    By marco.amusquivar in forum 2.x Help
    Replies: 3
    Last Post: Mar 21, 2012, 4:06 PM
  2. Using model var in mvc view
    By sinai.doron in forum 1.x Help
    Replies: 1
    Last Post: Nov 09, 2011, 5:19 PM
  3. MVC + PartialViewResult And Model
    By barroei in forum 1.x Help
    Replies: 3
    Last Post: Feb 15, 2011, 3:30 PM
  4. CheckboxSelection Model Event
    By BLOZZY in forum 1.x Help
    Replies: 2
    Last Post: Sep 07, 2010, 7:40 AM
  5. [CLOSED] CheckBoxSelection model
    By jwaite in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Feb 17, 2010, 7:33 AM

Posting Permissions