/// <summary> /// 添加表头复选框 /// </summary> private void AddHeadCheckbox(TableRowBuilder rowBuilder) { var headColumnBuilder = new TableHeadColumnBuilder(); headColumnBuilder.AddCheckBox(_config.Id); rowBuilder.AppendContent(headColumnBuilder); }
/// <summary> /// 添加内容 /// </summary> protected virtual void AddBody(TableBodyBuilder tableBodyBuilder) { var rowBuilder = new TableRowBuilder(); rowBuilder.NgFor($"let row of {_config.Id}.data"); rowBuilder.AppendContent(_config.Content); tableBodyBuilder.AppendContent(rowBuilder); }
/// <summary> /// 创建行生成器 /// </summary> private TableRowBuilder CreateRowBuilder() { var rowBuilder = new TableRowBuilder(); rowBuilder.NgIf($"{GetWrapperId()}.isShow(row)"); rowBuilder.AppendContent(_config.Content); return(rowBuilder); }
/// <summary> /// 添加标题列表 /// </summary> private void AddHeadTitles(TableRowBuilder rowBuilder) { foreach (var title in _config.Titles) { var headColumnBuilder = new TableHeadColumnBuilder(); headColumnBuilder.Title(title); rowBuilder.AppendContent(headColumnBuilder); } }
/// <summary> /// 添加标题列 /// </summary> private void AddHeadColumns(TableRowBuilder rowBuilder) { foreach (var column in _config.Columns) { var headColumnBuilder = new TableHeadColumnBuilder(); headColumnBuilder.Title(column.Title); headColumnBuilder.AddSort(column.GetSortKey()); rowBuilder.AppendContent(headColumnBuilder); } }
/// <summary> /// 添加表头复选框 /// </summary> private void AddHeadCheckbox(TableRowBuilder rowBuilder) { if (_config.AutoCreateHeadCheckbox == false) { return; } var headColumnBuilder = new TableHeadColumnBuilder(); headColumnBuilder.AddCheckBox(_config.Id); rowBuilder.AppendContent(headColumnBuilder); }
/// <summary> /// 添加行 /// </summary> protected void AddRow(TagBuilder tableBuilder) { if (_config.AutoCreateRow == false) { return; } var tableBodyBuilder = new TableBodyBuilder(); var rowBuilder = new TableRowBuilder(); rowBuilder.NgFor($"let row of {_config.Id}.data"); rowBuilder.AppendContent(_config.Content); tableBodyBuilder.AppendContent(rowBuilder); tableBuilder.AppendContent(tableBodyBuilder); }
/// <summary> /// 添加标题列 /// </summary> protected override void AddHeadColumns(TableRowBuilder rowBuilder) { for (int i = 0; i < _config.Columns.Count; i++) { var headColumnBuilder = new TableHeadColumnBuilder(); var column = _config.Columns[i]; if (i == 0) { AddCheckboxColumn(headColumnBuilder, column); } else { AddColumn(headColumnBuilder, column); } rowBuilder.AppendContent(headColumnBuilder); } }
/// <summary> /// 添加标题列 /// </summary> private void AddHeadColumns(TableRowBuilder rowBuilder) { foreach (var column in _config.Columns) { var headColumnBuilder = new TableHeadColumnBuilder(); if (column.IsCheckbox) { headColumnBuilder.AddCheckBox(_config.Id); } else { headColumnBuilder.Title(column.Title); headColumnBuilder.AddSort(column.GetSortKey()); } rowBuilder.AppendContent(headColumnBuilder); } }
/// <summary> /// 添加表头 /// </summary> protected virtual void AddHead(TagBuilder tableBuilder) { if (_config.Titles.Count == 0 || _config.AutoCreateHead == false) { return; } var headBuilder = new TableHeadBuilder(); tableBuilder.AppendContent(headBuilder); var rowBuilder = new TableRowBuilder(); headBuilder.AppendContent(rowBuilder); foreach (var title in _config.Titles) { var headColumnBuilder = new TableHeadColumnBuilder(); headColumnBuilder.Title(title); rowBuilder.AppendContent(headColumnBuilder); } }