} //добавлено из старой версии public CoreGrid(HttpContext context) { Context = context; AutoEncode = false; AutoWidth = false; ShrinkToFit = true; LoadOnce = false; ScrollToSelectedRow = false; EnableKeyboardNavigation = true; EditDialogSettings = new EditDialogSettings(); AddDialogSettings = new AddDialogSettings(); DeleteDialogSettings = new DeleteDialogSettings(); SearchDialogSettings = new SearchDialogSettings(); SearchToolBarSettings = new SearchToolBarSettings(); ViewRowDialogSettings = new ViewRowDialogSettings(); PagerSettings = new PagerSettings(); ToolBarSettings = new ToolBarSettings(); SortSettings = new SortSettings(); AppearanceSettings = new AppearanceSettings(); HierarchySettings = new HierarchySettings(); GroupSettings = new GroupSettings(); TreeGridSettings = new TreeGridSettings(); ExportSettings = new GridExportSettings(); ClientSideEvents = new ClientSideEvents(); PivotSettings = new PivotSettings(); Columns = new List <CoreColumn>(); HeaderGroups = new List <CoreGridHeaderGroup>(); DataUrl = ""; EditUrl = ""; ColumnReordering = false; RenderingMode = RenderingMode.Default; MultiSelect = false; MultiSelectMode = MultiSelectMode.SelectOnRowClick; MultiSelectKey = MultiSelectKey.None; Width = ""; Height = ""; ID = ""; IDPrefix = ""; PostData = ""; Responsive = false; StyleUI = "jQueryUI"; FunctionsHash = new Hashtable(); ReplacementsHash = new Hashtable(); }
public string Process() { AddDialogSettings addDialogSettings = _grid.AddDialogSettings; if (addDialogSettings.TopOffset != 0) { _jsonValues["top"] = addDialogSettings.TopOffset; } if (addDialogSettings.LeftOffset != 0) { _jsonValues["left"] = addDialogSettings.LeftOffset; } if (addDialogSettings.Width != 300) { _jsonValues["width"] = addDialogSettings.Width; } if (addDialogSettings.Height != 300) { _jsonValues["height"] = addDialogSettings.Height; } if (addDialogSettings.Modal) { _jsonValues["modal"] = true; } if (!addDialogSettings.Draggable) { _jsonValues["drag"] = false; } if (!string.IsNullOrEmpty(addDialogSettings.Caption)) { _jsonValues["addCaption"] = addDialogSettings.Caption; } if (!string.IsNullOrEmpty(addDialogSettings.SubmitText)) { _jsonValues["bSubmit"] = addDialogSettings.SubmitText; } if (!string.IsNullOrEmpty(addDialogSettings.CancelText)) { _jsonValues["bCancel"] = addDialogSettings.CancelText; } if (!string.IsNullOrEmpty(addDialogSettings.LoadingMessageText)) { _jsonValues["processData"] = addDialogSettings.LoadingMessageText; } if (addDialogSettings.CloseAfterAdding) { _jsonValues["closeAfterAdd"] = addDialogSettings.CloseAfterAdding; } if (!addDialogSettings.ClearAfterAdding) { _jsonValues["clearAfterAdd"] = false; } if (!addDialogSettings.ReloadAfterSubmit) { _jsonValues["reloadAfterSubmit"] = false; } if (!addDialogSettings.Resizable) { _jsonValues["resize"] = false; } _jsonValues["recreateForm"] = true; string json = JsonConvert.SerializeObject((object)_jsonValues); ClientSideEvents clientSideEvents = _grid.ClientSideEvents; json = JsonUtil.RenderClientSideEvent(json, "beforeShowForm", clientSideEvents.BeforeAddDialogShown); json = JsonUtil.RenderClientSideEvent(json, "afterShowForm", clientSideEvents.AfterAddDialogShown); json = JsonUtil.RenderClientSideEvent(json, "afterComplete", clientSideEvents.AfterAddDialogRowInserted); json = JsonUtil.RenderClientSideEvent(json, "errorTextFormat", "function(data) { return 'Error: ' + data.responseText }"); return(JsonUtil.RenderClientSideEvent(json, "editData", string.Format("{{ __RequestVerificationToken: jQuery('input[name=__RequestVerificationToken]').val() }}", _grid.ID))); }