Ejemplo n.º 1
0
 private void RenderClientSideEvents(StringBuilder sb, ClientSideEvents e)
 {
     this.RenderClientSideEvent(sb, e.BeforeAjaxRequest, "beforeRequest");
     this.RenderClientSideEvent(sb, e.BeforeRowSelect, "beforeSelectRow");
     this.RenderClientSideEvent(sb, e.GridInitialized, "gridComplete");
     this.RenderClientSideEvent(sb, e.LoadComplete, "loadComplete");
     this.RenderClientSideEvent(sb, e.LoadDataError, "loadError");
     this.RenderClientSideEvent(sb, e.CellSelect, "onCellSelect");
     this.RenderClientSideEvent(sb, e.RowDoubleClick, "ondblClickRow");
     this.RenderClientSideEvent(sb, e.BeforePageChange, "onPaging");
     this.RenderClientSideEvent(sb, e.RowRightClick, "onRightClickRow");
     this.RenderClientSideEvent(sb, e.RowSelect, "onSelectRow");
     this.RenderClientSideEvent(sb, e.ColumnSort, "onSortCol");
     this.RenderClientSideEvent(sb, e.SubGridBeforeRowExpand, "subGridBeforeExpand");
     this.RenderClientSideEvent(sb, e.SubGridRowExpanded, "subGridRowExpanded");
     this.RenderClientSideEvent(sb, e.SubGridRowCollapsed, "subGridRowColapsed");
     this.RenderClientSideEvent(sb, e.AfterEditCell, "afterEditCell");
     this.RenderClientSideEvent(sb, e.AfterSaveCell, "afterSaveCell");
     this.RenderClientSideEvent(sb, e.AfterSubmitCell, "afterSubmitCell");
     this.RenderClientSideEvent(sb, e.BeforeEditCell, "beforeEditCell");
     this.RenderClientSideEvent(sb, e.BeforeSaveCell, "beforeSaveCell");
     this.RenderClientSideEvent(sb, e.BeforeSubmitCell, "beforeSubmitCell");
     this.RenderClientSideEvent(sb, e.BeforeSubmitCell, "beforeSubmitCell");
     this.RenderClientSideEvent(sb, e.EditCellFormat, "formatCell");
     this.RenderClientSideEvent(sb, e.EditError, "errorCell");
     if (string.IsNullOrEmpty(e.LoadDataError))
     {
         this.RenderClientSideEvent(sb, "jqGrid_aspnet_loadErrorHandler", "loadError");
     }
 }
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 (!deleteDialogSettings.Resizable)
            {
                this._jsonValues["resize"] = 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;
            }
            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);
            return(JsonUtil.RenderClientSideEvent(json, "errorTextFormat", "function(data) { return 'Error: ' + data.responseText }"));
        }
Ejemplo n.º 3
0
 private void RenderClientSideEvents(StringBuilder sb, ClientSideEvents e)
 {
     this.RenderClientSideEvent(sb, e.BeforeAjaxRequest, "beforeRequest");
     this.RenderClientSideEvent(sb, e.BeforeRowSelect, "beforeSelectRow");
     this.RenderClientSideEvent(sb, e.GridInitialized, "gridComplete");
     this.RenderClientSideEvent(sb, e.LoadComplete, "loadComplete");
     this.RenderClientSideEvent(sb, e.LoadDataError, "loadError");
     this.RenderClientSideEvent(sb, e.CellSelect, "onCellSelect");
     this.RenderClientSideEvent(sb, e.RowDoubleClick, "ondblClickRow");
     this.RenderClientSideEvent(sb, e.BeforePageChange, "onPaging");
     this.RenderClientSideEvent(sb, e.RowRightClick, "onRightClickRow");
     this.RenderClientSideEvent(sb, e.RowSelect, "onSelectRow");
     this.RenderClientSideEvent(sb, e.ColumnSort, "onSortCol");
     this.RenderClientSideEvent(sb, e.SubGridBeforeRowExpand, "subGridBeforeExpand");
     this.RenderClientSideEvent(sb, e.SubGridRowExpanded, "subGridRowExpanded");
     this.RenderClientSideEvent(sb, e.SubGridRowCollapsed, "subGridRowColapsed");
     this.RenderClientSideEvent(sb, e.AfterEditCell, "afterEditCell");
     this.RenderClientSideEvent(sb, e.AfterSaveCell, "afterSaveCell");
     this.RenderClientSideEvent(sb, e.AfterSubmitCell, "afterSubmitCell");
     this.RenderClientSideEvent(sb, e.BeforeEditCell, "beforeEditCell");
     this.RenderClientSideEvent(sb, e.BeforeSaveCell, "beforeSaveCell");
     this.RenderClientSideEvent(sb, e.BeforeSubmitCell, "beforeSubmitCell");
     this.RenderClientSideEvent(sb, e.BeforeSubmitCell, "beforeSubmitCell");
     this.RenderClientSideEvent(sb, e.EditCellFormat, "formatCell");
     this.RenderClientSideEvent(sb, e.EditError, "errorCell");
     if (string.IsNullOrEmpty(e.LoadDataError))
     {
         this.RenderClientSideEvent(sb, "jqGrid_aspnet_loadErrorHandler", "loadError");
     }
 }