Exemplo n.º 1
0
        public string Process()
        {
            Hashtable hashtable = new Hashtable();

            if (_grid.SearchToolBarSettings.SearchToolBarAction == SearchToolBarAction.SearchOnKeyPress)
            {
                hashtable["searchOnEnter"] = false;
            }

            if (this._grid.SearchToolBarSettings.SearchOperators)         //дописано из старой
            {
                hashtable["searchOperators"] = true;
                hashtable["stringResult"]    = true;
            }

            string           text             = JsonConvert.SerializeObject((object)hashtable);
            ClientSideEvents clientSideEvents = _grid.ClientSideEvents;

            if (!string.IsNullOrEmpty(clientSideEvents.BeforeSearch))
            {
                text = JsonUtil.RenderClientSideEvent(text, "beforeSearch", clientSideEvents.BeforeSearch);
            }
            if (!string.IsNullOrEmpty(clientSideEvents.AfterSearch))
            {
                text = JsonUtil.RenderClientSideEvent(text, "afterSearch", clientSideEvents.AfterSearch);
            }
            return(text);
        }
Exemplo n.º 2
0
        }                                        //добавлено из старой версии

        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()
        {
            EditDialogSettings editDialogSettings = _grid.EditDialogSettings;

            if (editDialogSettings.TopOffset != 0)
            {
                _jsonValues["top"] = editDialogSettings.TopOffset;
            }
            if (editDialogSettings.LeftOffset != 0)
            {
                _jsonValues["left"] = editDialogSettings.LeftOffset;
            }
            if (editDialogSettings.Width != 300)
            {
                _jsonValues["width"] = editDialogSettings.Width;
            }
            if (editDialogSettings.Height != 300)
            {
                _jsonValues["height"] = editDialogSettings.Height;
            }
            if (editDialogSettings.Modal)
            {
                _jsonValues["modal"] = true;
            }
            if (!editDialogSettings.Draggable)
            {
                _jsonValues["drag"] = false;
            }
            if (!string.IsNullOrEmpty(editDialogSettings.Caption))
            {
                _jsonValues["editCaption"] = editDialogSettings.Caption;
            }
            if (!string.IsNullOrEmpty(editDialogSettings.SubmitText))
            {
                _jsonValues["bSubmit"] = editDialogSettings.SubmitText;
            }
            if (!string.IsNullOrEmpty(editDialogSettings.CancelText))
            {
                _jsonValues["bCancel"] = editDialogSettings.CancelText;
            }
            if (!string.IsNullOrEmpty(editDialogSettings.LoadingMessageText))
            {
                _jsonValues["processData"] = editDialogSettings.LoadingMessageText;
            }
            if (editDialogSettings.CloseAfterEditing)
            {
                _jsonValues["closeAfterEdit"] = true;
            }
            if (!editDialogSettings.ReloadAfterSubmit)
            {
                _jsonValues["reloadAfterSubmit"] = false;
            }
            if (!editDialogSettings.Resizable)
            {
                _jsonValues["resize"] = false;
            }
            _jsonValues["recreateForm"] = true;
            string           json             = JsonConvert.SerializeObject((object)_jsonValues);
            ClientSideEvents clientSideEvents = _grid.ClientSideEvents;

            json = JsonUtil.RenderClientSideEvent(json, "beforeShowForm", clientSideEvents.BeforeEditDialogShown);
            json = JsonUtil.RenderClientSideEvent(json, "afterShowForm", clientSideEvents.AfterEditDialogShown);
            json = JsonUtil.RenderClientSideEvent(json, "afterComplete", clientSideEvents.AfterEditDialogRowInserted);
            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)));
        }