
Andreas Kaech
Top achievements
Rank 1
Andreas Kaech
asked on 29 May 2008, 07:31 AM
Hi,
your example "Scrolling to the selected item" works fine in IE but not in Firefox. You see the selected Row a short time - then the cursor jumps to the top.
Could it be, that another function "disturbs" this action in Firefox?
Regards,
Andreas
your example "Scrolling to the selected item" works fine in IE but not in Firefox. You see the selected Row a short time - then the cursor jumps to the top.
Could it be, that another function "disturbs" this action in Firefox?
Regards,
Andreas
4 Answers, 1 is accepted
0
Hello Andreas Kaech,
Indeed this behavior can be observed. In order to workaround it you can try delaying the execution of the code. The code should look similar to this:
Let us know if further assistance is needed.
Best wishes,
Rosen
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
Indeed this behavior can be observed. In order to workaround it you can try delaying the execution of the code. The code should look similar to this:
function onGridCreated() |
{ |
var RadGrid1 = $find("<%= RadGrid1.ClientID %>"); |
//select one of the rows |
RadGrid1.get_masterTableView().get_dataItems()[17].set_selected("true"); |
// get the selected row |
var row = RadGrid1.get_masterTableView().get_selectedItems()[0]; |
if (row) |
{ |
setTimeout(function(){ |
var rowElement = row.get_element(); |
//get the main table scrollArea HTML element |
var scrollArea = RadGrid1.GridDataDiv; |
//check if the selected row is below the viewable grid area |
if((rowElement.offsetTop - scrollArea.scrollTop) + |
rowElement.offsetHeight + 20 > scrollArea.offsetHeight) |
{ |
//scroll down to selected row |
scrollArea.scrollTop = scrollArea.scrollTop + |
(rowElement.offsetTop - scrollArea.scrollTop) + |
(rowElement.offsetHeight - scrollArea.offsetHeight) + |
rowElement.offsetHeight; |
} |
//chck if the selected row is above the viewable grid area |
else if((rowElement.offsetTop - scrollArea.scrollTop) < 0) |
{ |
//scroll the selected row to the top |
scrollArea.scrollTop = rowElement.offsetTop; |
} |
}, 200); |
} |
} |
Let us know if further assistance is needed.
Best wishes,
Rosen
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
0

Andreas Kaech
Top achievements
Rank 1
answered on 30 May 2008, 02:35 PM
Hi Rosen,
thanks, you can check this thread as solved ;-)
Perhaps, in one of the next releases, this firefox-issue will be taken into consideration - who knows...
Best wishes,
Andreas
thanks, you can check this thread as solved ;-)
Perhaps, in one of the next releases, this firefox-issue will be taken into consideration - who knows...
Best wishes,
Andreas
0

Maas Prog
Top achievements
Rank 1
answered on 17 Apr 2010, 12:10 AM
Hi All - I am trying to move to selected row in a grid with many rows.... the selected row is not visible on page load. I have tried this code, but what happens is that on load I cannot select any row.
This is the line that is dying:
RadGrid1.get_masterTableView().get_dataItems()[17].set_selected("true");
I have put alerts after this in code and before and the ones before show but not after. I am using a self-referncing hierachical grid if that makes a difference.... and the selected row is in a child table... Any ideas?
Thanks
For
0

BaiH
Top achievements
Rank 1
answered on 19 Apr 2010, 11:34 AM
Maybe you should try selecting the appropriate detailTable's item, not the masterTableView's.
--BH
--BH