public virtual void InsertRecord(int index, object values, bool commit) { RequestManager.EnsureDirectEvent(); this.Call("insertRecord", index, values, commit); }
public void SetActive(bool active) { RequestManager.EnsureDirectEvent(); this.AddScript("{0}.getFilter({1}).setActive({2});", this.Plugin.ClientID, JSON.Serialize(this.DataIndex), JSON.Serialize(active)); }
public override void Flush() { string raw = this.html.ToString(); StringBuilder buffer = new StringBuilder(256); DirectResponse ajaxResponse = new DirectResponse(true); HttpContext context = HttpContext.Current; object isUpdate = context.Items["Ext.Net.Direct.Update"]; if (isUpdate != null && (bool)isUpdate) { this.ExtractUpdates(raw, buffer); } string dynamicHtml = this.ExtractDynamicHtml(raw); object isManual = context.Items["Ext.Net.Direct.Response.Manual"]; if (isManual != null && (bool)isManual) { if (raw.StartsWith("<Ext.Net.Direct.Response.Manual>")) { string script = dynamicHtml.ConcatWith(raw.RightOf("<Ext.Net.Direct.Response.Manual>").LeftOf("</Ext.Net.Direct.Response.Manual>")); byte[] rsp = System.Text.Encoding.UTF8.GetBytes(script); this.response.Write(rsp, 0, rsp.Length); this.response.Flush(); return; } } buffer.Append(dynamicHtml); string error = context == null ? null : (context.Error != null ? context.Error.ToString() : null); if (!ResourceManager.AjaxSuccess || error.IsNotEmpty()) { ajaxResponse.Success = false; if (error.IsNotEmpty()) { ajaxResponse.ErrorMessage = error; } else { ajaxResponse.ErrorMessage = ResourceManager.AjaxErrorMessage; } } else { if (ResourceManager.ReturnViewState) { ajaxResponse.ViewState = AjaxRequestFilter.GetHiddenInputValue(raw, BaseFilter.VIEWSTATE); ajaxResponse.ViewStateEncrypted = AjaxRequestFilter.GetHiddenInputValue(raw, BaseFilter.VIEWSTATEENCRYPTED); ajaxResponse.EventValidation = AjaxRequestFilter.GetHiddenInputValue(raw, BaseFilter.EVENTVALIDATION); } object obj = ResourceManager.ServiceResponse; if (obj is Response) { ajaxResponse.ServiceResponse = new ClientConfig().Serialize(obj); } else { ajaxResponse.ServiceResponse = obj != null?JSON.Serialize(obj) : null; } if (ResourceManager.ExtraParamsResponse.Count > 0) { ajaxResponse.ExtraParamsResponse = ResourceManager.ExtraParamsResponse.ToJson(); } if (ResourceManager.DirectMethodResult != null) { ajaxResponse.Result = ResourceManager.DirectMethodResult; } buffer.Append(raw.RightOf("<Ext.Net.Direct.Response>").LeftOf("</Ext.Net.Direct.Response>")); if (buffer.Length > 0) { ajaxResponse.Script = "<string>".ConcatWith(buffer.ToString()); } } bool isUpload = context != null && RequestManager.HasInputFieldMarker(context.Request); byte[] data = System.Text.Encoding.UTF8.GetBytes((isUpload ? "<textarea>" : "") + ajaxResponse.ToString() + (isUpload ? "</textarea>" : "")); this.response.Write(data, 0, data.Length); this.response.Flush(); }
public virtual void RemoveByIndex(int index) { RequestManager.EnsureDirectEvent(); this.Call("removeByIndex", index); }
public virtual void RemoveByText(string text) { RequestManager.EnsureDirectEvent(); this.Call("removeByText", text); }
public virtual void AddRecord(IDictionary <string, object> values) { RequestManager.EnsureDirectEvent(); this.Call("addRecord", values); }
public virtual void AddItem(string text, object value) { RequestManager.EnsureDirectEvent(); this.Call("addItem", text, value); }
public virtual void StopEditing() { RequestManager.EnsureDirectEvent(); this.Call("stopEditing"); }
public virtual void UpdateCell(object id, string dataIndex, object value) { RequestManager.EnsureDirectEvent(); this.AddScript("{0}.store.getById({1}).set({2},{3});", this.ClientID, JSON.Serialize(id), JSON.Serialize(dataIndex), JSON.Serialize(value)); }
public virtual void StartEditing(int rowIndex, int colIndex) { RequestManager.EnsureDirectEvent(); this.Call("startEditing", rowIndex, colIndex); }
public virtual void StopEditing(bool cancel) { RequestManager.EnsureDirectEvent(); this.Call("stopEditing", cancel); }
internal virtual void SetHideHeaders(bool hide) { RequestManager.EnsureDirectEvent(); this.AddScript("{0}.getView().mainHd.setDisplayed({1});", this.ClientID, JSON.Serialize(!hide)); }
public virtual void DeleteSelected() { RequestManager.EnsureDirectEvent(); this.Call("deleteSelected"); }
public virtual void AddRecord(object values, bool commit) { RequestManager.EnsureDirectEvent(); this.Call("addRecord", values, commit); }
public virtual void ScrollToTop() { RequestManager.EnsureDirectEvent(); this.Call("scrollToTop"); }
/// <summary> /// /// </summary> public virtual void RemoveAll() { RequestManager.EnsureDirectEvent(); this.Call("removeAll"); }
public virtual void InsertRecord(int index, IDictionary <string, object> values) { RequestManager.EnsureDirectEvent(); this.Call("insertRecord", index, values); }
public virtual void ClearFilters() { RequestManager.EnsureDirectEvent(); this.Call("clearFilters"); }
public virtual void InsertItem(int index, string text, object value) { RequestManager.EnsureDirectEvent(); this.Call("insertItem", index, text, value); }
/// <summary> /// Adds a filter to the collection and observes it for state change. /// </summary> /// <param name="filter">A filter configuration</param> public virtual void AddFilter(GridFilter filter) { RequestManager.EnsureDirectEvent(); this.Call("addFilter", new ClientConfig().Serialize(filter)); }
public virtual void RemoveByField(string field, object value) { RequestManager.EnsureDirectEvent(); this.Call("removeByField", field, value); }
public virtual void FocusCell(int row, int col) { RequestManager.EnsureDirectEvent(); this.Call("focusCell", row, col); }
public virtual void RemoveByValue(string value) { RequestManager.EnsureDirectEvent(); this.Call("removeByValue", value); }
public virtual void FocusRow(int row) { RequestManager.EnsureDirectEvent(); this.Call("focusRow", row); }
public void UpdateData() { RequestManager.EnsureDirectEvent(); this.AddScript("{0}={1};", this.ClientID, JSON.Serialize(this.Items)); }
public virtual void Refresh(bool headersToo) { RequestManager.EnsureDirectEvent(); this.Call("refresh", headersToo); }
/// <summary> /// /// </summary> /// <param name="keyBinding"></param> public virtual void AddKeyBinding(KeyBinding keyBinding) { RequestManager.EnsureDirectEvent(); this.Call("addBinding", JRawValue.From(new ClientConfig().Serialize(keyBinding, true))); }
public virtual void Refresh() { RequestManager.EnsureDirectEvent(); this.Call("refresh"); }
public void AddKeyBinding(KeyBinding keyBinding) { RequestManager.EnsureDirectEvent(); this.Call("addBinding", new JRawValue(new ClientConfig().SerializeInternal(keyBinding, this))); }
public void SetValue(string[] value) { RequestManager.EnsureDirectEvent(); this.AddScript("{0}.getFilter({1}).setValue({2});", this.Plugin.ClientID, JSON.Serialize(this.DataIndex), JSON.Serialize(value)); }