Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted on Mar 14, 2007 14:28
open dhtmlx forum
I am currently having a problem using your splitAt() function to freeze a left most column of my grid. &n...

I am currently having a problem using your splitAt() function to freeze a left most column of my grid.  It works fine if I definite the grid strictly using JavaScript.  However, if I define the columns and their attributes in the XML, the splitAt() function doesn’t seem to work correctly.  In my scenario, I don’t know how many columns I will need initially so I was hoping to define that information on the server side as I dynamically generate my XML.

 
I have attached a zip file with a simple HTML file which replicates the issue.  The first grid works correctly, but uses only Javascript to define column attributes.  The second and third grids do NOT work correct when the column

Attributes are defined in the XML.
Answer posted on Mar 14, 2007 14:29
You can use split with configuration from XML, but split command must be issued only after grid structure was defined, and before data was loaded. In your case it can be done by adding "call" tag with "splitAt" command directly to XML
Answer posted by GR on Jun 12, 2007 01:17
I have a grid control that is difined with XML (structure and data). Im trying to use splitAt function but it doesnt work. I tried using "call" in "beforeInit" section and in "afterInit",  but nothing works... As you replied the split function work only it is called after grids definition and before loading data. Is there a "middleInit"  that I can use in order to enable splitat function??  any idea???
Answer posted on Jun 12, 2007 11:04
The order of events in case of init from XML are next

a) if beforeInit section exists - commands from it processed
b) if configuration of grid exists
    c) configuration applied
    d) grid.init() called
    e) if afterInit section exists - commands from it processed
f) data from XML loaded

So afterInit processed exactly in necessary moment, but it is called only if have configuration of grid in head section

<rows>
    <head>
        <column id="z5" width="50" type="dyn" align="right" color="white" sort="str">Sales</column>
        <column width="150" type="ed" align="left" color="#d5f1ff" sort="str">Book Title</column>
        <column width="100" type="ed" align="left" color="#d5f1ff" sort="str">Author</column>
        <column width="80" type="price" align="right" sort="str">Price</column>
        <column width="80" type="ch" align="center" sort="str">In Store</column>
        <afterInit>
             <call command="splitAt"><param>2</param></call>
        </afterInit>
    </head>
    <row id="1">
Answer posted by GR on Jun 12, 2007 16:38
Im still having problems with splitAt, I got a javascript error: "Invalid argument". It seems that its impossible to use splitAt with XML configuration
Answer posted on Jun 12, 2007 19:11
Please contact us directly at dhtmlx@scand.com and provide your customer number - I will send you fully functional example, how it works.
Answer posted by sematik (Support) on Dec 03, 2014 06:55

The information connected with ajax php upload progress bar and auto-complete-mode also can help you, so please check it too.