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:
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!!!!!
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!!!!!