Unplanned
Last Updated: 28 May 2020 14:03 by Greg
Ron
Created on: 19 May 2020 09:09
Category: TileLayout
Type: Feature Request
8
Add / remove support for the TileLayout component
I would like to see the ability to dynamically add and remove items for the TileLayout component, ideally using drag & drop. My use case would be to have a TileLayout dashboard area to which I would like to drag & drop new items from a side toolbar. Additionally items should be removable from the dashboard area.
2 comments
Greg
Posted on: 28 May 2020 14:03

Hi Ron, I too put in a ticket for this.  I have code that adds an item. I took it from kendo.all.js  _initContainers function.  I am currently working on removing it and will post something once I work it out,  This is not production code so excuse the mess!

 

 var t2 = $("#tilelayout").data("kendoTileLayout")
        var containerSettings = {
           
            bodyTemplate: $("#first").html(),
            header: { text: 'Some Header' },
            order :2,
            colSpan: 1,
            rowSpan: 1,
           

        }
        var id = kendo.guid();
        var container = $('<div></div>').addClass("k-tilelayout-item k-card").attr('id', id);
        var headerSettings = containerSettings.header;

         if (headerSettings && (headerSettings.template || headerSettings.text)) {
            header = $('<div></div>').addClass("k-tilelayout-item-header k-card-header ");
            if (t2.options.reorderable) { //that.options.reorderable
                header.addClass("k-cursor-grab");
            }
            if (headerSettings.text) {
                headerContent = '<h5 class=\'' + "k-card-title" + '\'>' + headerSettings.text + '</h5> <span class="removeItem glyphicon glyphicon-remove-circle"></span>';
            }
            header.append(headerContent || kendo.template(headerSettings.template)({}));
            header.appendTo(container);
        }
        body = $('<div></div>').addClass("k-tilelayout-item-body k-card-body");
        body.append(kendo.template(containerSettings.bodyTemplate)({}));
        body.appendTo(container);
        container.appendTo(t2.element); //that.element
        t2._addContainer(container, containerSettings, 2, id); //that._addContainer(container, containerSettings, i, id);
ADMIN
Preslav
Posted on: 25 May 2020 12:03

Hello Ron,

Thank you for submitting this feature request. If it gets enough votes from our community, we will consider implementing it.

 

Regards,
Preslav
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.