I have a TreeGrid that works very nicely. I also have a “Back to Top” button on my page that is supposed to return the grid view back to the top rows. This is my code:
In the HTML for my button:
onclick='javascript:gotoHTreeTop()'....
In javascript:
function gotoHTreeTop()
{
mygrid.selectRow(0); // Pull top row into view.
mygrid.clearSelection(); // Clear the selection bar that selectRow() set.
}
This works, but it only clears the top row on the grid portion, not the “tree” portion. So, I have a row with a partial selection bar on it. My grid is set up so that the first column is the “tree” type, the rest are strings.
Sorry for taking so long to respond, Olga. I missed your reply for some reason, and have been busy.
We are using v2.5 build 91111 of dhtmlx.js. The issue seems to stem from the splitAt() function, because yes, I am using it in my treeGrid, and it also shows up in grids that use it. And it is the “frozen” part of the grid that remains marked with the select highlight.
An example of the init is as follows:
var mygrid = new dhtmlXGridObject('DshbdGridbox'); // The grid object itself.
mygrid.imgURL = 'DHTMLX/imgs/'; // Where to find images.
mygrid.setHeader (hTreeHeader); // Column headers.
mygrid.setInitWidths(hTreeWidths); // Column widths.
mygrid.setColAlign (hTreeCAlign); // Column alignments. All left-justified here.
mygrid.setColTypes (hTreeCTypes); // "data types" for each column.
mygrid.setColSorting(hTreeCSorts); // Sorting styles for each column.
mygrid.setEditable(false); // This is a RO tree for now.
mygrid.enableTreeGridLines(); // This version has tree lines.
mygrid.setImageSize(6,18); // Uses mod'd "leaf.gif" to draw node lines
mygrid.init(); // Init the object.
mygrid.enableAutoHeight(true, 500); // Allow growth, up to 500px.
mygrid.enableAlterCss( 'sea_0', 'sea_1', false, false ); // "Teal" shades for rows.
mygrid.setStyle('', 'color:black;', '', 'background:#649b9b;'); // BLACK text and darker Teal for highlight.
mygrid.splitAt(1); // "Freeze" the tree column.
mygrid.loadXML(hTreeXMLData); // Load data & display tree on-screen.
I downloaded the latest version, but still had the issue. I also had some other anomalies that I didn’t have time to solve, so went back to my original version.
Is it possible to get just the grid and tree grid JS files from you in the new version, and are they compatible with a v2.5 build 91111 base?
I have also attached a zip containing two files - a mock-up HTML and some sample data in an XML to show you the issue. Bring up the HTML page and click on “Back to Top”. A colored bar will appear on the top of the frozen section. This occurs with both treeGrids and just grids.
BTW - I will be on vacation now until 1/3/2011, so no immediate hurry (until I get back, of course )
Merry Christmas to all of you over there. HTree Demos.zip (518 KB)
As for problem with Demo2 - it is caused by usage of auto-height mode.
Auto-height and smart-rendering are mutual exclusive modes. ( ones tries to render as much as possible, while second uses the oposite strategy )
Get a guaranteed answer from DHTMLX technical support team
under the most suitable support plan