/// <summary>
        /// 设定/初始化一列。
        /// </summary>
        public void setPanelColumn(string sPanelID, ColumnModel mo, bool sort, int flex = 0, bool visiable = true)
        {
            int rfType = mo.WordType;
            var list   = this.GetCmp <GridPanel>(sPanelID);

            if ((rfType == CosDataBase.STRING_TYPE) ||
                (rfType == CosDataBase.INT_TYPE) ||
                (rfType == CosDataBase.SMALLINT_TYPE) ||
                (rfType == CosDataBase.LONGINT_TYPE) ||
                (rfType == CosDataBase.STRINGL_TYPE) ||
                (rfType == CosDataBase.SELSTR_TYPE) ||
                (rfType == CosDataBase.DATETIME_TYPE) ||
                (rfType == CosDataBase.DATE_TYPE) ||
                (rfType == CosDataBase.TIME_TYPE) ||
                (rfType == CosDataBase.BOOLEAN_TYPE) ||
                (rfType == CosDataBase.JOIN_TYPE) ||
                (rfType == CosDataBase.PARENTNAME_TYPE))
            {
                Column col = new Column();
                col.Text      = mo.WordName;
                col.DataIndex = mo.WordValue;
                col.Width     = mo.ColumnWidth;
                col.Sortable  = sort;
                //col.Visible = visiable;
                col.Hidden = !visiable;
                col.Flex   = flex;
                list.AddColumn(col);
            }
            else if (rfType == CosDataBase.FLOAT_TYPE)
            {
                NumberColumn col = new NumberColumn();
                col.Text      = mo.WordName;
                col.DataIndex = mo.WordValue;
                string s = "0.";
                for (int j = 0; j < AppSettingValues.FLOATDECIMAL; j++)
                {
                    s = s + "0";
                }
                col.Format   = s;
                col.Width    = mo.ColumnWidth;
                col.Sortable = sort;
                col.Visible  = visiable;
                col.Flex     = flex;
                list.AddColumn(col);
            }
            else if (rfType == CosDataBase.BOOLEANBOX_TYPE)
            {
                CheckColumn col = new CheckColumn();
                col.Text      = mo.WordName;
                col.DataIndex = mo.WordValue;
                col.Width     = 40;
                col.Sortable  = sort;
                col.Visible   = visiable;
                col.Flex      = flex;
                list.AddColumn(col);
            }
        }
Ejemplo n.º 2
0
        public void BuildGrid()
        {
            Ext.Net.GridView gridView;
            if (String.IsNullOrEmpty(this.columnExpand))
            {
                gridView = new Ext.Net.GridView();
            }
            else
            {
                gridView = new Ext.Net.GridView
                {
                    Configs = { ForceFit = true }
                };
            }

            if (ReadOnly == true)
            {
                foreach (LookupFormatData fmtData in this.dataTemplate)
                {
                    fmtData.ReadOnly = ReadOnly;
                }
            }

            foreach (LookupFormatData fmtData in this.dataTemplate)
            {
                fmtData.ID = fmtData.ID != "" ? fmtData.ID : fmtData.FieldName;
                if (fmtData.EditControl != null)
                {
                    Column colCbo = new Column
                    {
                        ID        = String.Format("{0}ColID", fmtData.ID),
                        DataIndex = fmtData.FieldName,
                        Text      = fmtData.FieldTitle,
                        Width     = fmtData.ColWidth,
                        Hidden    = fmtData.ColWidth == 0
                    };
                    if (String.Equals(fmtData.FieldName, this.columnExpand))
                    {
                        colCbo.Flex = 1;
                    }
                    //Makeup for option string
                    if (fmtData.IsRenderer)
                    {
                        string           funcRenderer = fmtData.FnRenderer;
                        Ext.Net.Renderer rd           = new Renderer {
                            Fn = SCOPE + "." + funcRenderer
                        };
                        colCbo.Renderer = rd;
                    }

                    if (!fmtData.ReadOnly)
                    {
                        colCbo.Editor.Add(fmtData.EditControl);
                    }
                    this.ColumnModel.Columns.Add(colCbo);
                }
                else if (fmtData.EditControl == null)
                {
                    switch (fmtData.Type)
                    {
                    case ModelFieldType.String:
                        #region String
                        Column colText = new Column
                        {
                            ID        = String.Format("{0}ColID", fmtData.ID),
                            DataIndex = fmtData.FieldName,
                            Text      = fmtData.FieldTitle,
                            Width     = fmtData.ColWidth,
                            Hidden    = fmtData.ColWidth == 0,
                            Align     = Alignment.Left
                        };
                        if (String.Equals(fmtData.FieldName, this.columnExpand))
                        {
                            colText.Flex = 1;
                        }
                        if (fmtData.IsRenderer)
                        {
                            string           funcRenderer = fmtData.FnRenderer;
                            Ext.Net.Renderer rd           = new Renderer {
                                Fn = SCOPE + "." + funcRenderer
                            };
                            colText.Renderer = rd;
                        }
                        if (!fmtData.ReadOnly == true)
                        {
                            TextField textEditor = new TextField
                            {
                                SelectOnFocus = true,
                                //AllowBlank = false,
                                //BlankText = "Not blank",
                                MsgTarget = MessageTarget.Side
                            };

                            if (fmtData.MaxLength > 0)
                            {
                                textEditor.MaxLength     = fmtData.MaxLength;
                                textEditor.MaxLengthText = String.Format("Chiều dài tối đa là {0} kí tự", textEditor.MaxLength);
                            }
                            if (fmtData.AllowBlank == false)
                            {
                                textEditor.AllowBlank = false;
                                textEditor.BlankText  = String.Format("Trường bắt buộc nhập giá trị");
                            }

                            colText.Editor.Add(textEditor);
                        }

                        this.ColumnModel.Columns.Add(colText);
                        #endregion
                        break;

                    case ModelFieldType.Boolean:
                        #region Boolean
                        CheckColumn colBool = new CheckColumn
                        {
                            ID        = String.Format("{0}ColID", fmtData.ID),
                            DataIndex = fmtData.FieldName,
                            Text      = fmtData.FieldTitle,
                            Width     = fmtData.ColWidth,
                            Hidden    = fmtData.ColWidth == 0,
                            Editable  = false,
                            Align     = Alignment.Center
                        };
                        if (String.Equals(fmtData.FieldName, this.columnExpand))
                        {
                            colBool.Flex = 1;
                        }
                        if (!fmtData.ReadOnly == true)
                        {
                            colBool.Editable = true;
                            //TextField cbEditor = new TextField { SelectOnFocus = true };
                            //Ext.Net.Checkbox cbEditor = new Checkbox { Cls = "x-grid-checkheader-editor" };
                            //colBool.Editor.Add(cbEditor);
                        }
                        this.ColumnModel.Columns.Add(colBool);
                        #endregion
                        break;

                    case ModelFieldType.Date:
                        #region Date
                        DateColumn colDate = new DateColumn
                        {
                            ID        = String.Format("{0}ColID", fmtData.ID),
                            DataIndex = fmtData.FieldName,
                            Text      = fmtData.FieldTitle,
                            Width     = fmtData.ColWidth,
                            Hidden    = fmtData.ColWidth == 0,
                            Format    = "dd/MM/yyyy",
                            Align     = Alignment.Center
                        };
                        if (String.Equals(fmtData.FieldName, this.columnExpand))
                        {
                            colDate.Flex = 1;
                        }
                        if (!fmtData.ReadOnly == true)
                        {
                            DateField dateEditor = new DateField
                            {
                                ID            = String.Format("{0}_{1}_dateEditor", this.ClientID, fmtData.FieldName),
                                Format        = "dd/MM/yyyy",
                                Vtype         = "daterange",
                                SelectOnFocus = true
                            };
                            colDate.Editor.Add(dateEditor);
                        }
                        //                            colDate.Renderer.Handler = @"if(value == 'Mon Jan 01 1 07:00:00 GMT+0700 (SE Asia Standard Time)')
                        //                                           {return null;}
                        //                                           else{return Ext.Date.format(value, 'd/m/Y');}";
                        this.ColumnModel.Columns.Add(colDate);
                        #endregion
                        break;

                    case ModelFieldType.Float:
                        #region Float
                        NumberColumn colFloat = new NumberColumn
                        {
                            ID        = String.Format("{0}ColID", fmtData.ID),
                            DataIndex = fmtData.FieldName,
                            Text      = fmtData.FieldTitle,
                            Width     = fmtData.ColWidth,
                            Hidden    = fmtData.ColWidth == 0,
                            Format    = "0.00/i",
                            Align     = Alignment.Right,
                        };
                        if (!String.IsNullOrEmpty(fmtData.Format))
                        {
                            colFloat.Format = fmtData.Format;
                        }
                        if (String.Equals(fmtData.FieldName, this.columnExpand))
                        {
                            colFloat.Flex = 1;
                        }
                        if (!fmtData.ReadOnly == true)
                        {
                            //phongdd-100
                            //TextField textEdit = new TextField { StyleSpec = "text-align:right;vertical-align:bottom", SelectOnFocus = true };
                            NumberField FloatEditInt = new NumberField
                            {
                                StyleSpec        = "text-align:right;vertical-align:bottom",
                                SelectOnFocus    = true,
                                MinValue         = 0,
                                AllowDecimals    = true,
                                DecimalPrecision = 3
                            };
                            //end phongdd-100
                            colFloat.Editor.Add(FloatEditInt);
                        }
                        this.ColumnModel.Columns.Add(colFloat);
                        #endregion
                        break;

                    case ModelFieldType.Int:
                        #region Number
                        NumberColumn colNumber = new NumberColumn
                        {
                            ID        = String.Format("{0}ColID", fmtData.ID),
                            DataIndex = fmtData.FieldName,
                            Text      = fmtData.FieldTitle,
                            Width     = fmtData.ColWidth,
                            Hidden    = fmtData.ColWidth == 0,
                            Align     = Alignment.Right,
                        };
                        if (!String.IsNullOrEmpty(fmtData.Format))
                        {
                            colNumber.Format = fmtData.Format;
                        }
                        if (String.Equals(fmtData.FieldName, this.columnExpand))
                        {
                            colNumber.Flex = 1;
                        }
                        //Bat buoc go dau phay
                        if (!fmtData.ReadOnly == true)
                        {
                            //phongdd-100
                            //TextField textEditInt = new TextField { StyleSpec = "text-align:right;vertical-align:bottom", SelectOnFocus = true };
                            NumberField textEditInt = new NumberField {
                                StyleSpec = "text-align:right;vertical-align:bottom", SelectOnFocus = true, MinValue = 0, AllowDecimals = true
                            };
                            //end phongdd-100
                            colNumber.Editor.Add(textEditInt);
                        }
                        this.ColumnModel.Columns.Add(colNumber);
                        #endregion
                        break;

                    default:
                        #region auto
                        Column colAuto = new Column
                        {
                            ID        = String.Format("{0}ColID", fmtData.ID),
                            DataIndex = fmtData.FieldName,
                            Text      = fmtData.FieldTitle,
                            Width     = fmtData.ColWidth,
                            Hidden    = fmtData.ColWidth == 0,
                            Align     = Alignment.Left
                        };
                        if (String.Equals(fmtData.FieldName, this.columnExpand))
                        {
                            colAuto.Flex = 1;
                        }
                        if (fmtData.ReadOnly == true)
                        {
                            TextField textEditAuto = new TextField {
                                StyleSpec = "text-align:right;vertical-align:bottom", SelectOnFocus = true
                            };
                            colAuto.Editor.Add(textEditAuto);
                        }
                        this.ColumnModel.Columns.Add(colAuto);
                        #endregion
                        break;
                    }
                }
            }
            this.toolTip = new ToolTip
            {
                Delegate   = ".x-grid3-cell",
                TrackMouse = true,
            };
            this.Plugins.Add(new CellEditing {
                ClicksToEdit = 1
            });
            this.ToolTips.Add(toolTip);
            this.SelectionModel.Add(new CellSelectionModel {
            });
            this.View.Add(gridView);
        }
Ejemplo n.º 3
0
        internal static void CreateUnBoundGrid(this IBoundGrid grid)
        {
            try
            {
                grid.BeginInit();

                grid.Columns.Clear();
                foreach (GridColumnInfo info in ADInfoBll.Instance.GetGridColumnInfos(grid.GridName))
                {
                    // 有些列是要设置值但不可见的,例如Id
                    //if (!Authority.AuthorizeByRule(info.ColumnVisible))
                    //    continue;

                    switch (info.GridColumnType)
                    {
                    case GridColumnType.NoColumn:
                        break;

                    case GridColumnType.CheckColumn:
                    {
                        CheckColumn column = grid.AddCheckColumn(info.GridColumnName);
                        SetColumnProperties(column, info, grid);
                    }
                    break;

                    case GridColumnType.Normal:
                    {
                        Xceed.Grid.Column column;
                        if (grid.Columns[info.GridColumnName] != null)
                        {
                            //throw new ArgumentException("there have already exist column " + info.GridColumnName);
                            continue;
                        }
                        else
                        {
                            column = new Xceed.Grid.Column(info.GridColumnName, GridColumnInfoHelper.CreateType(info));
                        }

                        SetColumnProperties(column, info, grid);

                        GridFactory.CreateCellViewerManager(column, info, grid.DisplayManager);
                        bool readOnly = Authority.AuthorizeByRule(info.ReadOnly);
                        if (readOnly)
                        {
                            column.ReadOnly = readOnly;
                        }
                        else
                        {
                            GridFactory.CreateCellEditorManager(column, info, grid.DisplayManager);
                        }

                        grid.Columns.Add(column);
                    }
                    break;

                    case GridColumnType.WarningColumn:
                    {
                        Columns.WarningColumn column = new Columns.WarningColumn(info.GridColumnName, info.PropertyName);
                        grid.Columns.Add(column);
                    }
                    break;

                    case GridColumnType.StatColumn:
                    {
                        Xceed.Grid.Column column = new Xceed.Grid.Column(info.GridColumnName, GridColumnInfoHelper.CreateType(info));
                        SetColumnProperties(column, info, grid);
                        GridFactory.CreateCellViewerManager(column, info, grid.DisplayManager);
                        column.ReadOnly = true;
                        grid.Columns.Add(column);
                    }
                    break;

                    case GridColumnType.ExpressionColumn:
                    {
                        Xceed.Grid.Column column = new Xceed.Grid.Column(info.GridColumnName, GridColumnInfoHelper.CreateType(info));
                        SetColumnProperties(column, info, grid);
                        GridFactory.CreateCellViewerManager(column, info, grid.DisplayManager);
                        bool readOnly = Authority.AuthorizeByRule(info.ReadOnly);
                        if (readOnly)
                        {
                            column.ReadOnly = readOnly;
                        }
                        else
                        {
                            GridFactory.CreateCellEditorManager(column, info, grid.DisplayManager);
                        }
                        grid.Columns.Add(column);
                    }
                    break;

                    case GridColumnType.ImageColumn:
                    {
                        Xceed.Grid.Column column = new Xceed.Grid.Column(info.GridColumnName, typeof(System.Drawing.Image));
                        SetColumnProperties(column, info, grid);
                        column.ReadOnly = true;
                        column.MaxWidth = 72;
                        grid.Columns.Add(column);
                    }
                    break;

                    case GridColumnType.SplitColumn:
                    {
                        Xceed.Grid.Column column = new Xceed.Grid.Column(info.GridColumnName, typeof(string));
                        SetColumnProperties(column, info, grid);
                        column.ReadOnly  = true;
                        column.BackColor = System.Drawing.Color.LightGray;
                        column.Title     = " ";
                        column.MaxWidth  = 5;
                        column.Width     = 5;
                        grid.Columns.Add(column);
                    }
                    break;

                    case GridColumnType.UnboundColumn:
                    {
                        Xceed.Grid.Column column = new Xceed.Grid.Column(info.GridColumnName, GridColumnInfoHelper.CreateType(info));
                        SetColumnProperties(column, info, grid);

                        GridFactory.CreateCellViewerManager(column, info, grid.DisplayManager);
                        bool readOnly = Authority.AuthorizeByRule(info.ReadOnly);
                        if (readOnly)
                        {
                            column.ReadOnly = readOnly;
                        }
                        else
                        {
                            GridFactory.CreateCellEditorManager(column, info, grid.DisplayManager);
                        }

                        grid.Columns.Add(column);
                    }
                    break;

                    case GridColumnType.IndexColumn:
                    {
                        Xceed.Grid.Column column = new Xceed.Grid.Column(info.GridColumnName, typeof(int));
                        SetColumnProperties(column, info, grid);
                        column.ReadOnly = true;

                        grid.Columns.Add(column);
                    }
                    break;

                    default:
                        throw new NotSupportedException("Invalide gridcolumnType of " + info.GridColumnType + " in " + info.Name);
                    }
                }
            }
            catch (Exception ex)
            {
                ExceptionProcess.ProcessWithNotify(ex);
            }
            finally
            {
                grid.EndInit();
            }

            grid.CreateSumRow();
            grid.CreateGroups();
            grid.CreateEvents();

            grid.BoundGridHelper.CreateColumnManageRowEvent();
            grid.SetColumnManagerRowHorizontalAlignment();
            grid.CreateMultiColumnHeaderColumnManagerRow();
        }
Ejemplo n.º 4
0
    private void LoadColumnForGrid(DataTable table)
    {
        string[] headerColumn      = ("" + ColumnHeader).Split(',');
        string[] widthList         = ("" + ColumnWidth).Split(',');
        string[] render            = ("" + Render).Split(',');
        int      columnCount       = table.Columns.Count;
        bool     usingHeaderColumn = (headerColumn.Count() == columnCount);

        if (!string.IsNullOrEmpty(LockedColumn))
        {
            Ext.Net.LockingGridView lkv = new LockingGridView()
            {
                ID = "lkv",
            };
            GridPanel1.View.Add(lkv);
        }
        else if (!string.IsNullOrEmpty(GroupField))
        {
            Ext.Net.GroupingView group = new GroupingView()
            {
                ID                = "GroupingView1",
                ForceFit          = false,
                MarkDirty         = false,
                ShowGroupName     = false,
                EnableNoGroups    = true,
                HideGroupedColumn = HideGrouped
            };
            GridPanel1.View.Add(group);
        }
        for (int i = 0; i < columnCount; i++)
        {
            if (table.Columns[i].ColumnName == IDProperty && DisplayPrimaryColumn == false)
            {
                continue;
            }
            switch (table.Columns[i].DataType.ToString())
            {
            case "System.Boolean":
                string _render = GetRender(render, table.Columns[i].ColumnName);
                if (!string.IsNullOrEmpty(_render))
                {
                    Column _column = new Column();
                    _column.ColumnID    = table.Columns[i].ColumnName;
                    _column.DataIndex   = table.Columns[i].ColumnName;
                    _column.Header      = usingHeaderColumn ? headerColumn[i].Trim() : table.Columns[i].ColumnName;
                    _column.Locked      = GetLockingStatus(table.Columns[i].ColumnName);
                    _column.Width       = GetColumnWidth(widthList, table.Columns[i].ColumnName);
                    _column.Renderer.Fn = _render;
                    GridPanel1.ColumnModel.Columns.Add(_column);
                }
                else
                {
                    CheckColumn chkColumn = new CheckColumn();
                    chkColumn.ColumnID  = table.Columns[i].ColumnName;
                    chkColumn.DataIndex = table.Columns[i].ColumnName;
                    chkColumn.Header    = usingHeaderColumn ? headerColumn[i].Trim() : table.Columns[i].ColumnName;
                    chkColumn.Locked    = GetLockingStatus(table.Columns[i].ColumnName);
                    chkColumn.Width     = GetColumnWidth(widthList, table.Columns[i].ColumnName);
                    GridPanel1.ColumnModel.Columns.Add(chkColumn);
                }
                break;

            case "System.DateTime":
                DateColumn dcolumn = new DateColumn();
                dcolumn.ColumnID  = table.Columns[i].ColumnName;
                dcolumn.DataIndex = table.Columns[i].ColumnName;
                dcolumn.Header    = usingHeaderColumn ? headerColumn[i].Trim() : table.Columns[i].ColumnName;
                dcolumn.Format    = "dd/MM/yyyy";
                dcolumn.Locked    = GetLockingStatus(table.Columns[i].ColumnName);
                dcolumn.Width     = GetColumnWidth(widthList, table.Columns[i].ColumnName);
                GridPanel1.ColumnModel.Columns.Add(dcolumn);
                break;

            default:
                Column column = new Column();
                column.ColumnID    = table.Columns[i].ColumnName;
                column.DataIndex   = table.Columns[i].ColumnName;
                column.Header      = usingHeaderColumn ? headerColumn[i].Trim() : table.Columns[i].ColumnName;
                column.Locked      = GetLockingStatus(table.Columns[i].ColumnName);
                column.Width       = GetColumnWidth(widthList, table.Columns[i].ColumnName);
                column.Renderer.Fn = GetRender(render, table.Columns[i].ColumnName);     //"RenderHightLight";
                GridPanel1.ColumnModel.Columns.Add(column);
                break;
            }
        }
    }
Ejemplo n.º 5
0
        public virtual ColumnBase CreateColumn()
        {
            ColumnBase column;

            if (HasChildren)
            {
                column = new Column {
                    Text = Header
                };

                if (ConfigureColumnHandler != null)
                {
                    ConfigureColumnHandler(column);
                }

                return(column);
            }

            var editor = CreateEditor();

            if (CreateColumnHandler != null)
            {
                column = CreateColumnHandler(this);
                if (editor != null)
                {
                    column.Editor.Add(editor);
                }

                if (ConfigureColumnHandler != null)
                {
                    ConfigureColumnHandler(column);
                }

                return(column);
            }

            if (IsTreeColumn)
            {
                column = new TreeColumn
                {
                    DataIndex = ColumnNameIndex,
                    Text      = Header,
                    Width     = new Unit(Width),
                    Flex      = string.IsNullOrEmpty(Width) ? Flex : 0,
                    Sortable  = !string.IsNullOrEmpty(Sort),
                };
            }
            else
            {
                switch (ModelFieldType)
                {
                case ModelFieldType.Auto:
                    column = new Column
                    {
                        DataIndex = ColumnNameIndex,
                        Text      = Header,
                        Width     = new Unit(Width),
                        Flex      = string.IsNullOrEmpty(Width) ? Flex : 0,
                        Hidden    = DefaultHidden,
                        Sortable  = !string.IsNullOrEmpty(Sort),
                    };
                    break;

                case ModelFieldType.String:
                    column = new Column
                    {
                        DataIndex = ColumnNameIndex,
                        Text      = Header,
                        Width     = new Unit(Width),
                        Flex      = string.IsNullOrEmpty(Width) ? Flex : 0,
                        Hidden    = DefaultHidden,
                        Wrap      = Wrap ?? true,
                        Sortable  = !string.IsNullOrEmpty(Sort),
                    };
                    break;

                case ModelFieldType.Int:
                    var intColumn = new NumberColumn
                    {
                        DataIndex = ColumnNameIndex,
                        Text      = Header,
                        Width     = new Unit(Width),
                        Flex      = string.IsNullOrEmpty(Width) ? Flex : 0,
                        Hidden    = DefaultHidden,
                        Sortable  = !string.IsNullOrEmpty(Sort),
                    };
                    if (!string.IsNullOrEmpty(Format))
                    {
                        intColumn.Format = GetIntFormat();
                    }
                    intColumn.Align = Alignment.Right;
                    //intColumn.Renderer.Handler = "debugger;return record.raw[metadata.column.dataIndex] == null && !value ? '' : value;";
                    column = intColumn;
                    break;

                case ModelFieldType.Float:
                    var floatColumn = new NumberColumn
                    {
                        DataIndex = ColumnNameIndex,
                        Text      = Header,
                        Flex      = string.IsNullOrEmpty(Width) ? Flex : 0,
                        Hidden    = DefaultHidden,
                        Sortable  = !string.IsNullOrEmpty(Sort),
                    };
                    if (!string.IsNullOrEmpty(Format))
                    {
                        floatColumn.Format = GetFloatFormat();
                    }
                    floatColumn.Align = Alignment.Right;
                    //floatColumn.Renderer.Handler = "debugger;return record.raw[metadata.column.dataIndex] == null && !value ? '' : value;";
                    column = floatColumn;
                    break;

                case ModelFieldType.Boolean:
                    if (EditModeForBool && CanEdit)
                    {
                        column = new CheckColumn
                        {
                            DataIndex     = ColumnNameIndex,
                            Text          = Header,
                            StopSelection = false,
                            Editable      = CanEdit,
                            Width         = new Unit(Width),
                            Flex          = string.IsNullOrEmpty(Width) ? Flex : 0,
                            Hidden        = DefaultHidden,
                            Sortable      = !string.IsNullOrEmpty(Sort),
                        };

                        if (column.Renderer == null)
                        {
                            column.Renderer = new Renderer();
                        }
                        column.Renderer.Handler = string.Format(
                            "if (!record.data.CanEdit) return '<span style=\"font-size:11px\">' + (record.data.{0} ? {1} : {2}) + '</span>'; return (new Ext.ux.CheckColumn()).renderer(record.data.{0});",
                            ColumnNameIndex,
                            JSON.Serialize(TrueText),
                            JSON.Serialize(FalseText));
                    }
                    else
                    {
                        column = new BooleanColumn
                        {
                            DataIndex = ColumnNameIndex,
                            Text      = Header,
                            TrueText  = TrueText,
                            FalseText = FalseText,
                            Width     = new Unit(Width),
                            Flex      = string.IsNullOrEmpty(Width) ? Flex : 0,
                            Hidden    = DefaultHidden,
                            Sortable  = !string.IsNullOrEmpty(Sort),
                        };
                    }

                    break;

                case ModelFieldType.Date:
                    column = new DateColumn
                    {
                        DataIndex = ColumnNameIndex,
                        Text      = Header,
                        Format    = GetDateFormat(),
                        Width     = new Unit(Width),
                        Flex      = string.IsNullOrEmpty(Width) ? Flex : 0,
                        Hidden    = DefaultHidden,
                        Sortable  = !string.IsNullOrEmpty(Sort),
                    };
                    break;

                default:
                    throw new ArgumentOutOfRangeException();
                }

                if (SummaryType != null)
                {
                    column.SummaryType     = SummaryType.Value;
                    column.SummaryRenderer = new Renderer {
                        Handler = SummaryRendererHandler
                    };
                    column.CustomSummaryType = CustomSummaryType;
                }
            }

            if (editor != null)
            {
                column.Editor.Add(editor);
            }

            if (!string.IsNullOrEmpty(RendererFunction))
            {
                var handler = RendererFunction.Contains(" ") ?
                              $"function (value, metadata, record, rowIndex, colIndex, store, view) {{\n{RendererFunction}\n}}"
                    : RendererFunction;
                column.Renderer = new Renderer {
                    Handler = handler,
                };
            }

            if (Locked)
            {
                column.Locked = true;
            }

            ConfigureColumnHandler?.Invoke(column);

            return(column);
        }