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

Problem with grid.select when Grouping a Column

1 Answer 100 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Tony Blonk
Top achievements
Rank 1
Tony Blonk asked on 25 Apr 2012, 06:29 PM
Hello,

I have a grid that when an item is selected, it changes an image based on the selected data item.

The code firing on the change event is as follows:

function showSelectedImage() {
 
                    var grid = $("#grid").data("kendoGrid");
 
                    //var data = grid.dataItem(grid.select());
 
                    grid.select().each(function () {
                        var data = grid.dataItem($(this));
                        if (null != data) {
                            $("#documentPreview").attr("src", data.ImageUrl);
                            $("#documentPreview").attr("alt", data.DocumentId);
 
                            $("#documentView").attr("src", data.ImageUrl);
                            $("#documentView").attr("alt", data.DocumentId);
 
 
 
                            $("#openImageHyperLink").attr("href", data.ImageUrl);
 
 
                            if ($("#documentPreview").is(":hidden")) {
                                $('#documentPreview').slideDown("slow", "easein", null);
 
                            }
 
                            if (null != data.ExtraPageUrls) {
                                buildPager(data.ExtraPageUrls);
                            }
                        }
                    });
 
                     
                }

This code works fine on an un-grouped grid.  However, when grouping is enabled, when you click an item in the second group, the data item return is the next one in the list, rather than the current one.  If you click the preceding group footer, you get the data item for the first item in the next group.

It is as if the group footer is bound to a data item, messing up the sequence......

E.G:

SUPPLIER NAME GROUP HEADER
DATA 1
DATA 2
SUPPLIER NAME GROUP FOOTER
DATA 3
DATA 4

-----

Clicking Data 3 row returns DATA 4 data item.

Clicking SUPPLIER NAME GROUP FOOTER returns DATA 3 Data Item

HELP!!!!!

1 Answer, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 26 Apr 2012, 05:04 PM
Hello Tony,

We manged to address the issue you have described and the fix will be included in the next official release. I have updated your telerik points as token of gratitude for reporting this issue.

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