[Ext net MVC] Server mapping and server proxy problem.

  1. #1

    [Ext net MVC] Server mapping and server proxy problem.

    Hi,
    I have a problem with my Ext net app.
    I have a grid panel with paging. On click on button refresh i have a server proxy refresh like:
    .ServerProxy(Html.X().AjaxProxy()
    				.Url(Url.Action("GetDeclarationToPage"))
    					)
    public ActionResult GetDeclarationToPage()
    		{
    			string SearchFor = "";
    			if(Session["LAST_SEARCHED"] != null)
    			 SearchFor = Session["LAST_SEARCHED"].ToString();
    
    			var Model = _unitOfWork.UserDeclarationRep.GetDeclarationViewModelForSurname(SearchFor,_userDeclarationFamily);
    		
    			return this.Store(Model.RaportModel);
    		}
    Problem is that in model i have model field with server mapping:
    new ModelField { Name = "OptionalParameter", ServerMapping = "OptionalParameter.ParametrDesc", Type = ModelFieldType.String },
    When i refresh page in my server mapping model field i have a "object.object" instead of my real data.
    What i have must do to get it work ?
  2. #2
    Hello @Ridikk12, and welcome to Ext.NET forums!

    I believe your question has been asked about a month ago here: MVC ServerMapping in GridPanel

    And here's an older question which helped on replying the recent one: ServerMapping with AjaxProxy in GridPanel.

    Short answer is that ServerMapping can't be used with a gridPanel loaded via Ajax.

    Alternatives are to either use just Mapping, doing the transformations on the method returning the model if code behind, or using a renderer if you can format the values on client (javaScript/browser) side.

    If you are curious about the renderer approach, here's an example using it: Simple Array Grid. It may or may not fit your needs.

    I hope this helps!
    Fabrício Murta
    Developer & Support Expert
  3. #3
    Thanks ! This help me a lot.

Similar Threads

  1. Replies: 2
    Last Post: Feb 05, 2015, 4:01 AM
  2. Gridpanel, server mapping
    By myaso in forum 2.x Help
    Replies: 4
    Last Post: Nov 29, 2012, 12:59 AM
  3. [CLOSED] Ajax proxy working only in development server
    By marco.morreale in forum 2.x Legacy Premium Help
    Replies: 7
    Last Post: Sep 18, 2012, 2:10 PM
  4. Replies: 13
    Last Post: Sep 07, 2012, 6:23 PM
  5. [CLOSED] How to place list objects in server mapping
    By sriram in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Nov 16, 2010, 5:28 AM

Tags for this Thread

Posting Permissions