Ext.Net.StoreResponseData.ToString C# (CSharp) Method

ToString() private method

private ToString ( ) : string
return string
        public override string ToString()
        {
            if (this.Data.IsEmpty() && (this.Confirmation == null || this.Confirmation.Count==0))
            {
                return null;
            }
            
            StringBuilder sb = new StringBuilder();
            sb.Append("{");

            if (this.Data.IsNotEmpty())
            {
                sb.AppendFormat("data:{0}, total: {1},", this.Data, this.Total);
            }
            
            string returnConfirmation = "";

            if (this.Confirmation != null && this.Confirmation.Count>0)
            {
                returnConfirmation = this.Confirmation.ToJson();
            }

            if (returnConfirmation.IsNotEmpty())
            {
                sb.AppendFormat("confirm:{0}", returnConfirmation);
            }
            else
            {
                sb.Remove(sb.Length - 1, 1);
            }

            sb.Append("}");

            return sb.ToString();
        }
    }

Usage Example

Exemplo n.º 1
0
        protected virtual void GenerateAjaxResponseScript()
        {
            StoreResponseData dataResponse = new StoreResponseData();

            dataResponse.Data = this.GetAjaxDataJson();
            PageProxy dsp = this.Proxy.Proxy as PageProxy;

            if (dsp == null && this.Proxy.Proxy != null)
            {
                return;
            }

            dataResponse.Total = dsp != null ? dsp.Total : 0;

            Response response = new Response(true);

            response.Data = dataResponse.ToString();

            this.AddScript(this.ClientID.ConcatWith(".callbackRefreshHandler(response, {serviceResponse: ", new ClientConfig().Serialize(response), "}, ", this.ClientID, ", o.eventType, o.action, o.extraParams);"));
            this.ajaxDataBindingRequired = false;
        }
All Usage Examples Of Ext.Net.StoreResponseData::ToString
StoreResponseData