Ejemplo n.º 1
0
        private IGridEditFormBuilder CreateEditFormBuilder(GridRenderingData renderingData, GridItem item,
                                                           Func <IGridActionCommand, IEnumerable <IGridButtonBuilder> > buttons, Func <object, string> action)
        {
            var commands = renderingData.Columns.OfType <IGridActionColumn>().SelectMany(column => column.Commands);

            var editCommand = commands.OfType <GridEditActionCommand>().FirstOrDefault() ?? new GridEditActionCommand();

            var buttonBuilders = buttons(editCommand).Select(builder =>
            {
                Func <IHtmlNode> result = () => builder.Create(item.DataItem);
                return(result);
            });

            var formHtmlAttributes = CreateFormAttributes(renderingData.FormId, action(item.DataItem));

            //formHtmlAttributes.Merge(renderingData.EditFormHtmlAttributes);

            return(new GridEditFormBuilder(new GridFormBuilder(formHtmlAttributes),
                                           () => renderingData.HtmlHelper.EditorForModel(item.DataItem,
                                                                                         renderingData.EditTemplateName,
                                                                                         renderingData.Columns.OfType <IGridForeignKeyColumn>().Select(c => c.SerializeSelectList),
                                                                                         renderingData.AdditionalViewData
                                                                                         ),
                                           buttonBuilders));
        }
Ejemplo n.º 2
0
        protected virtual IGridRowBuilder CreateGroupFooterRowBuilder(GridRenderingData renderingData, GridItem item)
        {
            var functionsGroup      = item.DataItem as AggregateFunctionsGroup;
            var itemAggregateResult = functionsGroup.GetAggregateResults(renderingData.Aggregates);

            return(new GridGroupFooterRowBuilder(renderingData.Columns.Select(column => cellBuilderFactory.CreateGroupFooterCellBuilder(column, itemAggregateResult))));
        }
 public IGridTableBuilder CreateDecoratedTableBuilder(IEnumerable<GridColData> colsData, GridRenderingData renderingData)
 {
     var tableBuilder = CreateTableBuilder(colsData);
     tableBuilder.Decorators.Add(new GridTableBuilderGroupColDecorator(renderingData.GroupMembers.Count()));
     tableBuilder.Decorators.Add(new GridTableBuilderDetailViewColDecorator(renderingData.HasDetailTemplate));
     return tableBuilder;
 }
Ejemplo n.º 4
0
 protected virtual IGridEditFormBuilder CreateEditFormBuilder(GridRenderingData renderingData, GridItem item)
 {
     return(CreateEditFormBuilder(renderingData,
                                  item,
                                  (command) => command.CreateEditButtons(renderingData.UrlBuilder, renderingData.HtmlHelper),
                                  renderingData.UrlBuilder.UpdateUrl
                                  ));
 }
Ejemplo n.º 5
0
 protected void AppendFooter(IHtmlNode table, GridRenderingData renderingData)
 {
     if (renderingData.ShowFooter)
     {
         var tfoot = CreateFooter(renderingData);
         tfoot.AppendTo(table);
     }
 }
Ejemplo n.º 6
0
        public IHtmlNode CreateFooter(GridRenderingData data)
        {
            var builder = rowBuilderFactory.CreateFooterBuilder(data);
            var tr      = builder.CreateRow();

            tr.AddClass(UIPrimitives.Grid.FooterTemplateRow);
            return(tr);
        }
Ejemplo n.º 7
0
        public IHtmlNode CreateBody(GridRenderingData renderingData)
        {
            var enumerator = new GridDataSourceEnumerator(renderingData.DataSource, itemCreatorFactory.Create(renderingData.DataKeyStore, renderingData), renderingData.InsertRowPosition);

            var rowBuilders = enumerator.Select(item => rowBuilderFactory.CreateBuilder(renderingData, item));

            return(CreateBody(rowBuilders));
        }
        public IHtmlNode CreateFooter(GridRenderingData data)
        {
            var builder = rowBuilderFactory.CreateFooterBuilder(data);
            var tr = builder.CreateRow();

            tr.AddClass(UIPrimitives.Grid.FooterTemplateRow);
            return tr;
        }
        public IHtmlNode CreateBody(GridRenderingData renderingData)
        {
            var enumerator = new GridDataSourceEnumerator(renderingData.DataSource, itemCreatorFactory.Create(renderingData.DataKeyStore, renderingData), renderingData.InsertRowPosition);

            var rowBuilders = enumerator.Select(item => rowBuilderFactory.CreateBuilder(renderingData, item));

            return CreateBody(rowBuilders);
        }
Ejemplo n.º 10
0
        protected virtual IGridRowBuilder CreateDataRowBuilder(GridRenderingData renderingData, GridItem item)
        {
            if (renderingData.RowTemplate != null)
            {
                return(new GridTemplateRowBuilder(td => renderingData.RowTemplate(item.DataItem, td), renderingData.Colspan));
            }

            return(new GridDataRowBuilder(item.DataItem, renderingData.Columns.Select(column => cellBuilderFactory.CreateDisplayCellBuilder(column, renderingData.HtmlHelper))));
        }
Ejemplo n.º 11
0
        protected virtual IHtmlNode CreateTable(GridRenderingData renderingData)
        {
            var tableBuilder = tableBuilderFactory.CreateDecoratedTableBuilder(renderingData.Columns.Select(c => new GridColData {
                Width = c.Width, Hidden = c.Hidden
            }), renderingData);

            return(tableBuilder.CreateTable()
                   .Attributes(renderingData.TableHtmlAttributes));
        }
Ejemplo n.º 12
0
        protected virtual IHtmlNode CreateContentTable(GridRenderingData renderingData)
        {
            var table = CreateTable(renderingData);

            var tbody = CreateBody(renderingData);

            tbody.AppendTo(table);

            return(table);
        }
Ejemplo n.º 13
0
        protected override void AppendData(IHtmlNode div, GridRenderingData renderingData)
        {
            AppendHeader(div, renderingData);

            var content = CreateContent(renderingData);

            content.AppendTo(div);

            AppendFooter(div, renderingData);
        }
Ejemplo n.º 14
0
        public IGridRowBuilder CreateBuilder(GridRenderingData renderingData, GridItem item)
        {
            var creator = BuilderRegistry[item.Type];

            ExecuteRowCallback(item, renderingData.Callback);

            var gridRowBuilder = creator(renderingData, item);

            return decoratorProvider.ApplyDecorators(gridRowBuilder, item, renderingData.HasDetailTemplate);
        }
Ejemplo n.º 15
0
        protected override void AppendData(IHtmlNode div, GridRenderingData renderingData)
        {
            AppendHeader(div,renderingData);

            var content = CreateContent(renderingData);

            content.AppendTo(div);

            AppendFooter(div, renderingData);
        }
Ejemplo n.º 16
0
        public IGridRowBuilder CreateBuilder(GridRenderingData renderingData, GridItem item)
        {
            var creator = BuilderRegistry[item.Type];

            ExecuteRowCallback(item, renderingData.Callback);

            var gridRowBuilder = creator(renderingData, item);

            return(decoratorProvider.ApplyDecorators(gridRowBuilder, item, renderingData.HasDetailTemplate));
        }
Ejemplo n.º 17
0
        protected virtual IHtmlNode CreateHeader(GridRenderingData renderingData)
        {
            var thead = new HtmlElement("thead").AddClass("k-grid-header");

            var tr = DataSectionBuilder.CreateHeader(renderingData);

            tr.AppendTo(thead);

            return(thead);
        }
Ejemplo n.º 18
0
        protected virtual IHtmlNode CreateContentTable(GridRenderingData renderingData)
        {
            var table = CreateTable(renderingData);

            var tbody = CreateBody(renderingData);

            tbody.AppendTo(table);

            return table;
        }
Ejemplo n.º 19
0
        protected virtual IHtmlNode CreateContent(GridRenderingData renderingData)
        {
            var content = new HtmlElement("div").AddClass(UIPrimitives.Grid.ScrollableContent)
                          .Css("height", renderingData.ScrollingHeight);

            var table = CreateContentTable(renderingData);

            table.AppendTo(content);

            return(content);
        }
Ejemplo n.º 20
0
        protected virtual IHtmlNode CreateFooter(GridRenderingData renderingData)
        {
            var tfoot = new HtmlElement("tfoot");

            tfoot.AddClass("k-grid-footer");

            var tr = DataSectionBuilder.CreateFooter(renderingData);

            tr.AppendTo(tfoot);
            return(tfoot);
        }
Ejemplo n.º 21
0
        protected virtual IHtmlNode CreateContent(GridRenderingData renderingData)
        {
            var content = new HtmlElement("div").AddClass(UIPrimitives.Grid.ScrollableContent)
                                            .Css("height", renderingData.ScrollingHeight);

            var table = CreateContentTable(renderingData);

            table.AppendTo(content);

            return content;
        }
Ejemplo n.º 22
0
        public virtual IGridRowBuilder CreateHeaderBuilder(GridRenderingData renderingData)
        {
            var builder = new GridRowBuilder(renderingData.Columns.Select(cellBuilderFactory.CreateHeaderCellBuilder));

            var item = new GridItem
            {
                GroupLevel = renderingData.GroupMembers.Count(),
                Type       = GridItemType.HeaderRow
            };

            return(decoratorProvider.ApplyDecorators(builder, item, renderingData.HasDetailTemplate));
        }
Ejemplo n.º 23
0
        public virtual IGridRowBuilder CreateHeaderBuilder(GridRenderingData renderingData)
        {
            var builder = new GridRowBuilder(renderingData.Columns.Select(cellBuilderFactory.CreateHeaderCellBuilder));

            var item = new GridItem
            {
                GroupLevel = renderingData.GroupMembers.Count(),
                Type = GridItemType.HeaderRow
            };

            return decoratorProvider.ApplyDecorators(builder, item, renderingData.HasDetailTemplate);
        }
Ejemplo n.º 24
0
 protected virtual IGridRowBuilder CreateDetailRowBuilder(GridRenderingData renderingData, GridItem item)
 {
     return(new GridDetailRowBuilder
     {
         Colspan = (renderingData.Colspan - 1) - item.GroupLevel,
         DataItem = item.DataItem,
         Template = renderingData.DetailTemplate,
         Expanded = item.Expanded,
         IsMasterAlternate = item is GridDetailViewItem && ((item as GridDetailViewItem).Parent.State & GridItemStates.Alternating) == GridItemStates.Alternating,
         Html = item.DetailRowHtml,
         HtmlAttributes = item.DetailRowHtmlAttributes
     });
 }
Ejemplo n.º 25
0
        protected virtual void AppendData(IHtmlNode div, GridRenderingData renderingData)
        {
            var table = CreateTable(renderingData);

            table.AppendTo(div);

            AppendHeader(table, renderingData);

            AppendFooter(table, renderingData);

            var tbody = CreateBody(renderingData);
            tbody.AppendTo(table);
        }
Ejemplo n.º 26
0
        protected virtual IGridRowBuilder CreateInsertRowBuilder(GridRenderingData renderingData, GridItem item)
        {
            switch (renderingData.EditMode)
            {
            //TODO: Implement InForm editing
            //case GridEditMode.InForm:
            //    return CreateInFormInsertRowBuilder(renderingData, item);
            case GridEditMode.PopUp:
                return(CreatePopUpInsertRowBuilder(renderingData, item));

            default:
                return(CreateInLineInsertRowBuilder(renderingData, item));
            }
        }
Ejemplo n.º 27
0
        protected virtual void AppendData(IHtmlNode div, GridRenderingData renderingData)
        {
            var table = CreateTable(renderingData);

            table.AppendTo(div);

            AppendHeader(table, renderingData);

            AppendFooter(table, renderingData);

            var tbody = CreateBody(renderingData);

            tbody.AppendTo(table);
        }
Ejemplo n.º 28
0
        public virtual IHtmlNode CreateGrid(IDictionary<string, object> htmlAttributes, GridFunctionalData functionalData, GridRenderingData renderingData)
        {
            var div = CreateWrapper(htmlAttributes);

            AppendTopToolBar(div, functionalData);

            AppendGroupHeader(div, functionalData);

            AppendData(div, renderingData);

            AppendBottomPager(div, functionalData);

            return div;
        }
Ejemplo n.º 29
0
        protected override IHtmlNode CreateFooter(GridRenderingData renderingData)
        {
            var div = new HtmlElement("div").AddClass("k-grid-footer");

            var wrapper = new HtmlElement("div").AddClass("k-grid-footer-wrap");
            wrapper.AppendTo(div);

            var table = CreateTable(renderingData);
            table.AppendTo(wrapper);

            var tfoot = DataSectionBuilder.CreateFooter(renderingData);
            tfoot.AppendTo(table);

            return div;
        }
Ejemplo n.º 30
0
        private IGridRowBuilder CreateInLineRowBuilder(GridRenderingData renderingData, GridItem item, Func <object, string> action, Func <IGridColumn, IGridHtmlHelper, IGridDataCellBuilder> cellBuilder)
        {
            var tableBuilder = tableBuilderFactory.CreateTableBuilder(renderingData.Columns.Select(c => new GridColData {
                Width = c.Width, Hidden = c.Hidden
            }));

            var cellBuilders = renderingData.Columns.Select(column => cellBuilder(column, renderingData.HtmlHelper));

            var formHtmlAttributes = CreateFormAttributes(renderingData.FormId, action(item.DataItem));

            //formHtmlAttributes.Merge(renderingData.EditFormHtmlAttributes);

            return(new GridInLineEditRowBuilder(tableBuilder, new GridFormBuilder(formHtmlAttributes),
                                                renderingData.Colspan, item.DataItem, cellBuilders));
        }
Ejemplo n.º 31
0
        protected override IHtmlNode CreateHeader(GridRenderingData renderingData)
        {
            var header = new HtmlElement("div").AddClass("k-grid-header");

            var headerWrapper = new HtmlElement("div").AddClass("k-grid-header-wrap");

            headerWrapper.AppendTo(header);

            var table = CreateTable(renderingData);

            table.AppendTo(headerWrapper);

            var thead = DataSectionBuilder.CreateHeader(renderingData);

            thead.AppendTo(table);

            return header;
        }
Ejemplo n.º 32
0
        protected override IHtmlNode CreateHeader(GridRenderingData renderingData)
        {
            var header = new HtmlElement("div").AddClass("k-grid-header");

            var headerWrapper = new HtmlElement("div").AddClass("k-grid-header-wrap");

            headerWrapper.AppendTo(header);

            var table = CreateTable(renderingData);

            table.AppendTo(headerWrapper);

            var thead = DataSectionBuilder.CreateHeader(renderingData);

            thead.AppendTo(table);

            return(header);
        }
Ejemplo n.º 33
0
        protected override IHtmlNode CreateFooter(GridRenderingData renderingData)
        {
            var div = new HtmlElement("div").AddClass("k-grid-footer");

            var wrapper = new HtmlElement("div").AddClass("k-grid-footer-wrap");

            wrapper.AppendTo(div);

            var table = CreateTable(renderingData);

            table.AppendTo(wrapper);

            var tfoot = DataSectionBuilder.CreateFooter(renderingData);

            tfoot.AppendTo(table);

            return(div);
        }
Ejemplo n.º 34
0
        protected virtual IGridRowBuilder CreateGroupRowBuilder(GridRenderingData renderingData, GridItem item)
        {
            var groupKey = ((IGroup)item.DataItem).Key;

            var colspan = renderingData.Colspan - item.GroupLevel;

            var member = renderingData.GroupMembers.ElementAtOrDefault(item.GroupLevel);

            var column = renderingData.Columns.OfType <IGridBoundColumn>().FirstOrDefault(c => c.Member == member);

            var format = column != null && column.Format.HasValue() ? column.Format : "{0}";


            var template = new HtmlTemplate <GridGroupAggregateResult>
            {
                InlineTemplate = (result) => "{0}: {1}".FormatWith(result.Title, format.FormatWith(ExtractForeignKeyText(column, result.Key)))
            };

            var title = member.AsTitle();

            if (column != null)
            {
                title = column.Title.HasValue() ? column.Title : column.Member.AsTitle();
                if (column.GroupHeaderTemplate.HasValue())
                {
                    template = column.GroupHeaderTemplate;
                }
            }

            var functionsGroup      = item.DataItem as AggregateFunctionsGroup;
            var itemAggregateResult = functionsGroup.GetAggregateResults(renderingData.Aggregates);

            var aggregateResult = new GridGroupAggregateResult(title, groupKey, itemAggregateResult);

            return(new GridGroupRowBuilder((container) => template.Apply(aggregateResult, container), colspan));
        }
Ejemplo n.º 35
0
 protected virtual IGridRowBuilder CreateInFormInsertRowBuilder(GridRenderingData renderingData, GridItem item)
 {
     return new GridInFormEditRowBuilder(CreateInsertFormBuilder(renderingData, item), renderingData.Colspan);
 }
Ejemplo n.º 36
0
        protected virtual IGridRowBuilder CreateDataRowBuilder(GridRenderingData renderingData, GridItem item)
        {
            if (renderingData.RowTemplate != null)
            {
                return new GridTemplateRowBuilder(td => renderingData.RowTemplate(item.DataItem, td), renderingData.Colspan);
            }

            return new GridDataRowBuilder(item.DataItem, renderingData.Columns.Select(column => cellBuilderFactory.CreateDisplayCellBuilder(column, renderingData.HtmlHelper)));
        }
Ejemplo n.º 37
0
 protected void AppendFooter(IHtmlNode table, GridRenderingData renderingData)
 {
     if (renderingData.ShowFooter)
     {
         var tfoot = CreateFooter(renderingData);
         tfoot.AppendTo(table);
     }
 }
Ejemplo n.º 38
0
        public IGridTableBuilder CreateDecoratedTableBuilder(IEnumerable <GridColData> colsData, GridRenderingData renderingData)
        {
            var tableBuilder = CreateTableBuilder(colsData);

            tableBuilder.Decorators.Add(new GridTableBuilderGroupColDecorator(renderingData.GroupMembers.Count()));
            tableBuilder.Decorators.Add(new GridTableBuilderDetailViewColDecorator(renderingData.HasDetailTemplate));
            return(tableBuilder);
        }
Ejemplo n.º 39
0
        protected void AppendHeader(IHtmlNode container, GridRenderingData renderingData)
        {
            var thead = CreateHeader(renderingData);

            thead.AppendTo(container);
        }
Ejemplo n.º 40
0
 protected virtual IHtmlNode CreateBody(GridRenderingData renderingData)
 {
     return(DataSectionBuilder.CreateBody(renderingData));
 }
Ejemplo n.º 41
0
 protected virtual IGridRowBuilder CreateGroupFooterRowBuilder(GridRenderingData renderingData, GridItem item)
 {
     var functionsGroup = item.DataItem as AggregateFunctionsGroup;
     var itemAggregateResult = functionsGroup.GetAggregateResults(renderingData.Aggregates);
     return new GridGroupFooterRowBuilder(renderingData.Columns.Select(column => cellBuilderFactory.CreateGroupFooterCellBuilder(column, itemAggregateResult)));
 }
Ejemplo n.º 42
0
        private IGridEditFormBuilder CreateEditFormBuilder(GridRenderingData renderingData, GridItem item, 
            Func<IGridActionCommand, IEnumerable<IGridButtonBuilder>> buttons, Func<object, string> action)
        {
            var commands = renderingData.Columns.OfType<IGridActionColumn>().SelectMany(column => column.Commands);

            var editCommand = commands.OfType<GridEditActionCommand>().FirstOrDefault() ?? new GridEditActionCommand();

            var buttonBuilders = buttons(editCommand).Select(builder =>
            {
                Func<IHtmlNode> result = () => builder.Create(item.DataItem);
                return result;
            });

            var formHtmlAttributes = CreateFormAttributes(renderingData.FormId, action(item.DataItem));
            //formHtmlAttributes.Merge(renderingData.EditFormHtmlAttributes);

            return new GridEditFormBuilder(new GridFormBuilder(formHtmlAttributes),
                () => renderingData.HtmlHelper.EditorForModel(item.DataItem,
                    renderingData.EditTemplateName,
                    renderingData.Columns.OfType<IGridForeignKeyColumn>().Select(c => c.SerializeSelectList),
                    renderingData.AdditionalViewData
                ),
                buttonBuilders);
        }
Ejemplo n.º 43
0
        protected virtual IHtmlNode CreateTable(GridRenderingData renderingData)
        {
            var tableBuilder = tableBuilderFactory.CreateDecoratedTableBuilder(renderingData.Columns.Select(c => new GridColData{ Width = c.Width, Hidden = c.Hidden}), renderingData);

            return tableBuilder.CreateTable()
                               .Attributes(renderingData.TableHtmlAttributes);
        }
Ejemplo n.º 44
0
        private IGridRowBuilder CreateInLineRowBuilder(GridRenderingData renderingData, GridItem item, Func<object, string> action, Func<IGridColumn, IGridHtmlHelper, IGridDataCellBuilder> cellBuilder)
        {
            var tableBuilder = tableBuilderFactory.CreateTableBuilder(renderingData.Columns.Select(c => new GridColData { Width = c.Width, Hidden = c.Hidden }));

            var cellBuilders = renderingData.Columns.Select(column => cellBuilder(column, renderingData.HtmlHelper));

            var formHtmlAttributes = CreateFormAttributes(renderingData.FormId, action(item.DataItem));
            //formHtmlAttributes.Merge(renderingData.EditFormHtmlAttributes);

            return new GridInLineEditRowBuilder(tableBuilder, new GridFormBuilder(formHtmlAttributes),
                                                renderingData.Colspan, item.DataItem, cellBuilders);
        }
Ejemplo n.º 45
0
 protected virtual IHtmlNode CreateBody(GridRenderingData renderingData)
 {
     return DataSectionBuilder.CreateBody(renderingData);
 }
Ejemplo n.º 46
0
 protected virtual IGridRowBuilder CreateEmptyRowBuilder(GridRenderingData renderingData, GridItem item)
 {
     return(new GridEmptyRowBuilder(renderingData.Colspan, renderingData.NoRecordsTemplate));
 }
Ejemplo n.º 47
0
        protected virtual IGridRowBuilder CreateGroupRowBuilder(GridRenderingData renderingData, GridItem item)
        {
            var groupKey = ((IGroup) item.DataItem).Key;

            var colspan = renderingData.Colspan - item.GroupLevel;

            var member = renderingData.GroupMembers.ElementAtOrDefault(item.GroupLevel);

            var column = renderingData.Columns.OfType<IGridBoundColumn>().FirstOrDefault(c => c.Member == member);

            var format = column != null && column.Format.HasValue() ? column.Format : "{0}";

            var template = new HtmlTemplate<GridGroupAggregateResult>
            {
                InlineTemplate = (result) => "{0}: {1}".FormatWith(result.Title, format.FormatWith(ExtractForeignKeyText(column, result.Key)))
            };

            var title = member.AsTitle();

            if (column != null)
            {
                title = column.Title.HasValue() ? column.Title : column.Member.AsTitle();
                if (column.GroupHeaderTemplate.HasValue())
                {
                    template = column.GroupHeaderTemplate;
                }
            }

            var functionsGroup = item.DataItem as AggregateFunctionsGroup;
            var itemAggregateResult = functionsGroup.GetAggregateResults(renderingData.Aggregates);

            var aggregateResult = new GridGroupAggregateResult(title, groupKey, itemAggregateResult);

            return new GridGroupRowBuilder((container) => template.Apply(aggregateResult, container), colspan);
        }
Ejemplo n.º 48
0
 protected virtual IGridRowBuilder CreatePopUpInsertRowBuilder(GridRenderingData renderingData, GridItem item)
 {
     return(new GridPopUpInsertRowBuilder(CreateInsertFormBuilder(renderingData, item), renderingData.PopUpContainer));
 }
Ejemplo n.º 49
0
 protected void AppendHeader(IHtmlNode container, GridRenderingData renderingData)
 {
     var thead = CreateHeader(renderingData);
     thead.AppendTo(container);
 }
Ejemplo n.º 50
0
 protected virtual IGridRowBuilder CreatePopUpInsertRowBuilder(GridRenderingData renderingData, GridItem item)
 {
     return new GridPopUpInsertRowBuilder(CreateInsertFormBuilder(renderingData, item), renderingData.PopUpContainer);
 }
Ejemplo n.º 51
0
        public virtual IHtmlNode CreateGrid(IDictionary <string, object> htmlAttributes, GridFunctionalData functionalData, GridRenderingData renderingData)
        {
            var div = CreateWrapper(htmlAttributes);

            AppendTopToolBar(div, functionalData);

            AppendGroupHeader(div, functionalData);

            AppendData(div, renderingData);

            AppendBottomPager(div, functionalData);

            return(div);
        }
Ejemplo n.º 52
0
 protected virtual IGridRowBuilder CreateInsertRowBuilder(GridRenderingData renderingData, GridItem item)
 {
     switch (renderingData.EditMode)
     {
         //TODO: Implement InForm editing
         //case GridEditMode.InForm:
         //    return CreateInFormInsertRowBuilder(renderingData, item);
         case GridEditMode.PopUp:
             return CreatePopUpInsertRowBuilder(renderingData, item);
         default:
             return CreateInLineInsertRowBuilder(renderingData, item);
     }
 }
Ejemplo n.º 53
0
 protected virtual IGridRowBuilder CreateEmptyRowBuilder(GridRenderingData renderingData, GridItem item)
 {
     return new GridEmptyRowBuilder(renderingData.Colspan, renderingData.NoRecordsTemplate);
 }
Ejemplo n.º 54
0
 protected virtual IGridEditFormBuilder CreateInsertFormBuilder(GridRenderingData renderingData, GridItem item)
 {
     return CreateEditFormBuilder(renderingData,
         item,
         (command) => command.CreateInsertButtons(renderingData.UrlBuilder,
             renderingData.HtmlHelper),
         renderingData.UrlBuilder.InsertUrl
     );
 }
Ejemplo n.º 55
0
 protected virtual IGridRowBuilder CreateDetailRowBuilder(GridRenderingData renderingData, GridItem item)
 {
     return new GridDetailRowBuilder
     {
         Colspan = (renderingData.Colspan - 1) - item.GroupLevel,
         DataItem = item.DataItem,
         Template = renderingData.DetailTemplate,
         Expanded = item.Expanded,
         IsMasterAlternate = item is GridDetailViewItem && ((item as GridDetailViewItem).Parent.State & GridItemStates.Alternating) == GridItemStates.Alternating,
         Html = item.DetailRowHtml,
         HtmlAttributes = item.DetailRowHtmlAttributes
     };
 }
Ejemplo n.º 56
0
 protected virtual IGridRowBuilder CreateInLineInsertRowBuilder(GridRenderingData renderingData, GridItem item)
 {
     return CreateInLineRowBuilder(renderingData, item, renderingData.UrlBuilder.InsertUrl, cellBuilderFactory.CreateInsertCellBuilder);
 }
Ejemplo n.º 57
0
 protected virtual IGridRowBuilder CreateInFormInsertRowBuilder(GridRenderingData renderingData, GridItem item)
 {
     return(new GridInFormEditRowBuilder(CreateInsertFormBuilder(renderingData, item), renderingData.Colspan));
 }
Ejemplo n.º 58
0
        protected virtual IHtmlNode CreateFooter(GridRenderingData renderingData)
        {
            var tfoot = new HtmlElement("tfoot");
            tfoot.AddClass("k-grid-footer");

            var tr = DataSectionBuilder.CreateFooter(renderingData);
            tr.AppendTo(tfoot);
            return tfoot;
        }
Ejemplo n.º 59
0
 protected virtual IGridRowBuilder CreateInLineInsertRowBuilder(GridRenderingData renderingData, GridItem item)
 {
     return(CreateInLineRowBuilder(renderingData, item, renderingData.UrlBuilder.InsertUrl, cellBuilderFactory.CreateInsertCellBuilder));
 }
Ejemplo n.º 60
0
        protected virtual IHtmlNode CreateHeader(GridRenderingData renderingData)
        {
            var thead = new HtmlElement("thead").AddClass("k-grid-header");

            var tr = DataSectionBuilder.CreateHeader(renderingData);
            tr.AppendTo(thead);

            return thead;
        }