Ejemplo n.º 1
0
        public string Process()
        {
            SearchDialogSettings searchDialogSettings = this._grid.SearchDialogSettings;

            if (searchDialogSettings.TopOffset != 0)
            {
                this._jsonValues["top"] = searchDialogSettings.TopOffset;
            }
            if (searchDialogSettings.LeftOffset != 0)
            {
                this._jsonValues["left"] = searchDialogSettings.LeftOffset;
            }
            if (searchDialogSettings.Width != 300)
            {
                this._jsonValues["width"] = searchDialogSettings.Width;
            }
            if (searchDialogSettings.Height != 300)
            {
                this._jsonValues["height"] = searchDialogSettings.Height;
            }
            if (searchDialogSettings.Modal)
            {
                this._jsonValues["modal"] = true;
            }
            if (!searchDialogSettings.Draggable)
            {
                this._jsonValues["drag"] = false;
            }
            if (!string.IsNullOrEmpty(searchDialogSettings.FindButtonText))
            {
                this._jsonValues["Find"] = searchDialogSettings.FindButtonText;
            }
            if (!string.IsNullOrEmpty(searchDialogSettings.ResetButtonText))
            {
                this._jsonValues["Clear"] = searchDialogSettings.ResetButtonText;
            }
            if (searchDialogSettings.MultipleSearch)
            {
                this._jsonValues["multipleSearch"] = true;
            }
            //zhh
            if (searchDialogSettings.ShowQuery)
            {
                this._jsonValues["showQuery"] = true;
            }
            if (searchDialogSettings.ValidateInput)
            {
                this._jsonValues["checkInput"] = true;
            }
            if (!searchDialogSettings.Resizable)
            {
                this._jsonValues["resize"] = false;
            }
            if (searchDialogSettings.CloseOnEscape)
            {
                this._jsonValues["closeOnEscape"] = true;
            }
            this._jsonValues["recreateForm"] = true;
            //return new JavaScriptSerializer().Serialize(this._jsonValues);
            string           json             = new JavaScriptSerializer().Serialize(this._jsonValues);
            ClientSideEvents clientSideEvents = this._grid.ClientSideEvents;

            json = JsonUtil.RenderClientSideEvent(json, "beforeShowSearch", clientSideEvents.BeforeSearchDialogShown);
            return(JsonUtil.RenderClientSideEvent(json, "afterShowSearch", clientSideEvents.AfterSearchDialogShown));
        }
Ejemplo n.º 2
0
        public string Process()
        {
            DeleteDialogSettings deleteDialogSettings = this._grid.DeleteDialogSettings;

            if (deleteDialogSettings.TopOffset != 0)
            {
                this._jsonValues["top"] = deleteDialogSettings.TopOffset;
            }
            if (deleteDialogSettings.LeftOffset != 0)
            {
                this._jsonValues["left"] = deleteDialogSettings.LeftOffset;
            }
            if (deleteDialogSettings.Width != 300)
            {
                this._jsonValues["width"] = deleteDialogSettings.Width;
            }
            if (deleteDialogSettings.Height != 300)
            {
                this._jsonValues["height"] = deleteDialogSettings.Height;
            }
            if (deleteDialogSettings.Modal)
            {
                this._jsonValues["modal"] = true;
            }
            if (!deleteDialogSettings.Draggable)
            {
                this._jsonValues["drag"] = false;
            }
            if (!string.IsNullOrEmpty(deleteDialogSettings.SubmitText))
            {
                this._jsonValues["bSubmit"] = deleteDialogSettings.SubmitText;
            }
            if (!string.IsNullOrEmpty(deleteDialogSettings.CancelText))
            {
                this._jsonValues["bCancel"] = deleteDialogSettings.CancelText;
            }
            if (!string.IsNullOrEmpty(deleteDialogSettings.LoadingMessageText))
            {
                this._jsonValues["processData"] = deleteDialogSettings.LoadingMessageText;
            }
            if (!string.IsNullOrEmpty(deleteDialogSettings.Caption))
            {
                this._jsonValues["caption"] = deleteDialogSettings.Caption;
            }
            if (!string.IsNullOrEmpty(deleteDialogSettings.DeleteMessage))
            {
                this._jsonValues["msg"] = deleteDialogSettings.DeleteMessage;
            }
            if (!deleteDialogSettings.ReloadAfterSubmit)
            {
                this._jsonValues["reloadAfterSubmit"] = false;
            }
            if (!deleteDialogSettings.Resizable)
            {
                this._jsonValues["resize"] = false;
            }
            this._jsonValues["recreateForm"] = true;
            string           json             = new JavaScriptSerializer().Serialize(this._jsonValues);
            ClientSideEvents clientSideEvents = this._grid.ClientSideEvents;

            json = JsonUtil.RenderClientSideEvent(json, "beforeShowForm", clientSideEvents.BeforeDeleteDialogShown);
            json = JsonUtil.RenderClientSideEvent(json, "afterShowForm", clientSideEvents.AfterDeleteDialogShown);
            json = JsonUtil.RenderClientSideEvent(json, "afterComplete", clientSideEvents.AfterDeleteDialogRowDeleted);
            json = JsonUtil.RenderClientSideEvent(json, "beforeSubmit", clientSideEvents.BeforeDelDialogSubmit);
            json = JsonUtil.RenderClientSideEvent(json, "serializeDelData", clientSideEvents.SerializeDelData);
            json = JsonUtil.RenderClientSideEvent(json, "errorTextFormat", "function(data) { return '´íÎó: ' + data.responseText }");
            return(JsonUtil.RenderClientSideEvent(json, "delData", string.Format("{{ __RequestVerificationToken: jQuery('input[name=__RequestVerificationToken]').val() }}", this._grid.ID)));
        }