[FIXED] Horizontal scrolling problem with GridEditor
Author:
anonym
01 6th, 2009 in
xn--9ou.com
edit
In response to my thead (http://extjs.com/forum/showthread.php?t=16137) in the help forum, I found that the locked column is not taken into consideration when determining the need for a horizontal scroll. Just for some hint (I have to admit that this is my first time to play with extjs code and will probably miss something :">), I add the following snippet to Ext.grid.Gridview -> ensureVisible() method:
// calculate width of locked columns
var lockedWidth = 0;
var _count = cm.getColumnCount();
var _col = 0;
while(_col < _count) {
var _c = cm.getColumnById(cm.getColumnId(_col));
if (_c.locked)
lockedWidth += cm.getColumnWidth(_col);
else
break;
_col++;
}
And in the same function, change the following two line:
var sbot = stop + ch;
// var sright = sleft + c.clientWidth;
var sright = sleft + c.clientWidth - lockedWidth;
}else if(cright > sright){
// c.scrollLeft = cright-c.clientWidth;
c.scrollLeft = cright-c.clientWidth+lockedWidth;
This solves my problem when scrolling horizontally with arrow keys.
Thanks for you attention :)
#If you have any other info about this subject , Please add it free.# |