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

Can we have the Instructional text of Grouping to appear always even after we do Grouping by 1 column

1 Answer 17 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mansoor
Top achievements
Rank 1
Mansoor asked on 23 Jul 2014, 07:38 AM
Hi

My client has an requirement to show the instructional text 'Drag a column header and drop it here to group by that column' to appear always even though we do already have a grouping done.

Currently the text appears only when no grouping is done and disappears as soon as we do a group by any one of the column but my requirement is to make this text appear all the time.

Please try on this fiddle where there is default grouping on one of the column.

http://jsfiddle.net/Mans/j7cvN/3/

I have tried doing it in Databound event but was not lucky since it is disappearing.

Thanks in advance

1 Answer, 1 is accepted

Sort by
0
Accepted
Dimiter Madjarov
Telerik team
answered on 23 Jul 2014, 08:59 AM
Hello Mansoor,


I would suggest to implement this custom solution in a setTimeout call inside the dataBound event handler.
E.g.
function dataBound(e) {
    setTimeout(function () {
        var grid = $("#grid").data("kendoGrid");
        var groupHeader = grid.wrapper.find(".k-grouping-header");
        var groupHeaderText = groupHeader.clone().children().remove().end().text();
 
        if (!groupHeaderText) {
            groupHeader.append("Drag a column header and drop it here to group by that column");
        }
    });
}

Here is the updated jsFiddle example. I wish you a great day!

Regards,
Dimiter Madjarov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Grid
Asked by
Mansoor
Top achievements
Rank 1
Answers by
Dimiter Madjarov
Telerik team
Share this question
or