This is a migrated thread and some comments may be shown as answers.

BodyTemplateId

3 Answers 209 Views
TileLayout
This is a migrated thread and some comments may be shown as answers.
Hung
Top achievements
Rank 1
Veteran
Hung asked on 08 Aug 2020, 03:53 PM

Currently in Splitter, when adding a new pane, I can use LoadContentFrom("Action","Controller") to load content 

For a TitleLayout, when adding a new container, I can only use BodyTemplateId("stringTemplateID")

Is there a way for me to simulate BodyTemplateId ("Action","Controller") to load data into TitleLayout from a Controller/Action?

Thanks.

 

 

3 Answers, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 12 Aug 2020, 12:43 PM

Hi Hung,

At present, the TileLayout widget has not been designed to connect to a remote data source. Rather, the containers should be created and the components within those containers should connect to the respective remote controller. 

The only approach that is not featuring the AJAX request is to pass the configuration via the model on the page. It is important to point out that the structure and data types have to be the correct ones, otherwise, it will not be correctly bound.

Let me know if you have any questions.

Regards,


Nikolay
Progress Telerik

0
Hung
Top achievements
Rank 1
Veteran
answered on 13 Aug 2020, 04:46 PM

I have another issue: using API to update colSpan did not work. 

        // title definition
        @(Html.Kendo().TileLayout()
    .Name("tilelayout1")
    .Columns(12)
    .RowsHeight("200px")
    .ColumnsWidth("8.25%")
    .Containers(c =>
    {
    c.Add().Header(h => h.Text("panel Conversions ")).BodyTemplateId("panelConversionsGrid").ColSpan(1).RowSpan(2);
    c.Add().Header(h => h.Text("panel Chart ")).BodyTemplateId("panelChart").ColSpan(1).RowSpan(2);
    c.Add().Header(h => h.Text("panel Users ")).BodyTemplateId("panelUsersGrid").ColSpan(2).RowSpan(1);
    })
    .Reorderable(true)
    .Resizable()
    .Events(e => e.Reorder("onReorderLayout1x").Resize("onResizeLayout1x"))
)        // panel
        var tilelayoutitems_0 = $("#tilelayout1").data("kendoTileLayout").items[0];
        console.log(tilelayoutitems_0.colSpan);
        // output 1
        tilelayoutitems_0.colSpan = 6;
        console.log(tilelayoutitems_0.colSpan);
        // output 6
        But the screen is not expand accordingly

0
Nikolay
Telerik team
answered on 18 Aug 2020, 12:57 PM

Hi Hung,

The height and width of the containers of the TileLayout could be alternated via its options. Here is an example:

var containers = $("#tileLayout").getKendoTileLayout().options.containers;
containers[0].colSpan =4;
$("#tileLayout").getKendoTileLayout().setOptions({containers:containers});

Let me know if you have any questions.

Regards,
Nikolay
Progress Telerik

Tags
TileLayout
Asked by
Hung
Top achievements
Rank 1
Veteran
Answers by
Nikolay
Telerik team
Hung
Top achievements
Rank 1
Veteran
Share this question
or