Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by GR on Apr 23, 2008 10:57
open dhtmlx forum
SplitAt method

Im trying to use splitAt on my grid that is definded completely by XML (columns an rows). But I always get an error on javscript. My grid uses setOnLoadingStart and setOnLoadingEnd function to display a progress var, I noticed that deleting this functions the split function works correctly. Is this a bug?
PD: Im calling the splitAt on the header of mi XLM file in <afterInit> tag
Answer posted by Support on Apr 24, 2008 04:05
The problem can't be reconstructed locally, the usage of events can't harm anything ( basically events fired in any case, even if you not set custom code to them )
Maybe it somehow related to code which you are using inside those handlers.

If problem still occurs for you - please provide any kind of sample where it can be reconstructed.
Answer posted by GR on Apr 24, 2008 16:33

I have an example of my problem with splitAt method. See attachment.

Try to open index.html, at the biggining it loads witout the first four columns, but when you comment this lines:
mygrid_ldp.setOnLoadingStart(PresentarBarraProgesoLDP);
mygrid_ldp.setOnLoadingEnd(OcultarBarraProgesoLDP);
And changing DISPLAY property to the span:
<span id="SpanPrincipalLDP" style="DISPLAY: block; height: 100%;">
the grid loads correctly.
Could you help me to find the problem?

PD: Im using 1.5 professional version (not included in attachment)

Attachments (1)
Answer posted by Support on Apr 25, 2008 02:45
Problem caused not by using the onXLE and onXLS events, but by initializing grid in hidden block, basically it not a problem for the grid in normal case, but in split mode grid must know correct sizes to render correctly, and while in hidden state all sizes set to zero, so the size of left grid area calculated incorrectly.

To resolve problem you can just use visibility:hidden instead of display:none

Please check updated file.
Attachments (1)
index.zip1.44 Kb
Answer posted by GR on Apr 25, 2008 09:27
Thank you very much, splitAt function is working now, but just in the first load. When I try to call again the function buildTreeGrid_ldp (with different values) I got a javascript error:
Error: 'this._fake._bfs_setSizes' in null or not an object.

What do you thing is wrong in my code?
Answer posted by Support on Apr 25, 2008 10:20
The grid in split mode can't be reset with different configuration , you need to fully recreate it
    grid.destructor();
    grid = new dhtmlXGridObject(...);
    ... new configuration initialization...