What is MVC - AjaxStoreResult.cs replacement Ext 2.0

  1. #1

    What is MVC - AjaxStoreResult.cs replacement Ext 2.0

    What is the replacement for the following class for MVC project using ext 2.0? If comment out lines with ConfirmationList and use this I am getting
    error "Uncaught TypeError: Cannot read property 'internalid' of undefined ext.asd line 18"

    public class AjaxStoreResult : ActionResult
    {
    private object _data;
    private int _total;
    private StoreResponseFormat responseFormat = StoreResponseFormat.Load;
    private SaveStoreResponse saveResponse;

    #region Constructor(s)

    public AjaxStoreResult() { }

    public AjaxStoreResult(object data)
    {
    this.Data = data;
    }

    public AjaxStoreResult(object data, int totalCount) : this(data)
    {
    this.Total = totalCount;
    }

    public AjaxStoreResult(StoreResponseFormat responseFormat)
    {
    this.ResponseFormat = responseFormat;
    }

    #endregion


    public object Data
    {
    get { return this._data; }
    set { this._data = value; }
    }


    public int Total
    {
    get { return this._total; }
    set { this._total = value; }
    }


    public StoreResponseFormat ResponseFormat
    {
    get { return this.responseFormat; }
    set { this.responseFormat = value; }
    }


    public SaveStoreResponse SaveResponse
    {
    get
    {
    if(this.saveResponse == null)
    {
    this.saveResponse = new SaveStoreResponse();
    }
    return this.saveResponse;
    }
    }

    public override void ExecuteResult(ControllerContext context)
    {
    switch (this.ResponseFormat)
    {
    case StoreResponseFormat.Load:
    StoreResponseData storeResponse = new StoreResponseData();
    storeResponse.Data = JSON.Serialize(this.Data);
    storeResponse.Total = this.Total;
    storeResponse.Return();
    break;
    case StoreResponseFormat.Save:
    Response response = new Response(true);
    response.Success = this.SaveResponse.Success;
    response.Message = this.SaveResponse.Message;
    StoreResponseData saveResponse = new StoreResponseData();
    saveResponse.Confirmation = this.SaveResponse.ConfirmationList;
    saveResponse= this.SaveResponse;
    response.Data = saveResponse.ToString();

    response.Return();
    break;
    default:
    throw new ArgumentOutOfRangeException();
    }
    }
    }

    public enum StoreResponseFormat
    {
    Load,
    Save
    }

    public class SaveStoreResponse
    {
    private bool success = true;
    private string message;

    public bool Success
    {
    get { return this.success; }
    set { this.success = value; }
    }

    public string Message
    {
    get { return this.message; }
    set { this.message = value; }
    }

    public ConfirmationList ConfirmationList { get; set; }
    }
    Last edited by dpk; Aug 20, 2012 at 8:19 PM.
  2. #2
    Hi, check the changelog:

    https://examples2.ext.net/#/Getting_...nts/CHANGELOG/

    116. The server AjaxStoreResult class has been renamed to StoreResult.

Similar Threads

  1. AddLabelCls replacement
    By Zdenek in forum 2.x Help
    Replies: 2
    Last Post: Aug 16, 2012, 5:08 PM
  2. Replies: 4
    Last Post: Jul 09, 2012, 6:08 PM
  3. [CLOSED] AjaxStoreResult and ExtraParams
    By Stefanaccio in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Oct 28, 2010, 5:24 PM
  4. [CLOSED] [1.0] MVC AjaxStoreResult Question
    By Timothy in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Feb 26, 2010, 10:14 AM
  5. [CLOSED] Need help to find replacement to "onLoad()"
    By Jurke in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Jan 19, 2009, 6:17 AM

Tags for this Thread

Posting Permissions