NoNick
October 17, 2012, 10:08am
#1
Hello!
I have two grid on two different site.
The grid code is same but first site the selectedrow automaticly scroll into view, the second side it doesn’t!
The code:
[code]
var ar = <?php echo $list;?>
var mygrid;
function doInitGrid(){
mygrid = new dhtmlXGridObject(“dhtmlxGridSellSumList”);
mygrid.setImagePath(“images/dhtmlx/”)
mygrid.setHeader(“Menny.,Megnevezés,Bruttó Ár(Ft)”);
if (ar.length<13){
mygrid.setInitWidths(“75,150,150”);
}else{
mygrid.setInitWidths(“75,150,130”);
}
mygrid.setColAlign(“center,center,right”);
mygrid.setColTypes(“ro,ro,ro”);
mygrid.enableAlterCss(“even_row”);
mygrid.init();
mygrid.setStyle(“background-color:rgb(255,205,25);font-size:18px;font-weight:bold”,“color:white;font-size:18px;padding-top:10px;padding-bottom:10px;padding-right:5px;”,"",“background-color:rgb(225,225,225);color:red;”);
mygrid.parse(ar,“jsarray”);
}
doInitGrid();
mygrid.selectRow(mygrid.getRowsNum()-1);[/code]
Please beware that grid adjust only inner scroll, if you have grid in some other scrollable container - it will not be adjusted to make row visible.
NoNick
October 18, 2012, 3:37pm
#4
My grid is in a simple div like this:
[code]
var ar = <?php echo $list;?>
var mygrid;
function doInitGrid(){
mygrid = new dhtmlXGridObject(“dhtmlxGridSellSumList”);
mygrid.setImagePath(“images/dhtmlx/”)
mygrid.setHeader(“Menny.,Megnevezés,Bruttó Ár(Ft)”);
if (ar.length<13){
mygrid.setInitWidths(“75,150,150”);
}else{
mygrid.setInitWidths(“75,150,130”);
}
mygrid.setColAlign(“center,center,right”);
mygrid.setColTypes(“ro,ro,ro”);
mygrid.enableAlterCss(“even_row”,“odd_row”);
mygrid.init();
mygrid.setStyle(“background-color:rgb(255,205,25);font-size:18px;font-weight:bold”,“color:white;font-size:18px;padding-top:10px;padding-bottom:10px;padding-right:5px;”,"",“background-color:rgb(205,205,205);color:red;”);
mygrid.parse(ar,“jsarray”);
}
doInitGrid();
mygrid.selectRow(mygrid.getRowsNum()-1);
</script>
</div>
</td>
[/code]
sematik
October 19, 2012, 3:07pm
#5
Unfortunately the issue cannot be reconstructed locally.
If issue still occurs - please, provide a complete demo where the issue can be reconstructed.
Here you can find a tutorial about creating a complete demo:
docs.dhtmlx.com/doku.php?id=othe … leted_demo
NoNick
October 23, 2012, 12:56pm
#6
Also what should be the problem instead overflow property ???
I haven’t overflow in my stylesheet in this section
NoNick
October 31, 2012, 11:30am
#7
I can’t do a complete demo because it’s a very great site with lot of ajaxing.
Please somebody tell me what should be the problem!!!
NoNick
October 31, 2012, 1:07pm
#8
I found the solution:
[code] doInitGrid();
function select_last_row (){
mygrid.selectRow(mygrid.getRowsNum()-1);
}
setTimeout(“select_last_row()”,300);
[/code]