Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Martin on Mar 18, 2008 06:34
open dhtmlx forum
Span in header with xml loading

Hey!

I'm using the grid with loading config from a xml file because i got dynamic columns.

I want the last column to be a span over 3 cells. I tried this xml :

<rows>
    <head>
        <beforeInit>
            <call command="setOnColumnSort">
                <param>customColumnSort</param>
            </call>
            <call command="setSkin">
                <param>mawmail</param>
            </call>
            <call command="enableRowsHover">
                <param>true</param>
                <param>grid_hover</param>
            </call>
        </beforeInit>
        <column width="150" type="ro" align="left" sort="str">E-mail adres</column>
        <column width="150" type="ro" align="left" sort="str">Groep(en)</column>
        <column width="150" type="ro" align="right" sort="str">Naam</column>
        <column width="150" type="ro" align="right" sort="str">Beroep</column>
        <column width="150" type="ro" align="right" sort="str">Opties</column>
        <afterInit>
            <call command="loadXML">
                <param>/mailcampaign/abonnees/getOverview</param>
            </call>
            <call command="attachHeader">
                <param>E-mail adres,Groep(en),Naam,Beroep,Opties,#cspan,#cspan</param>
            </call>
        </afterInit>
    </head>
</rows>

But then i got 2 header rows. The seconde is the correct one. But when i leave out the <column> tags i get an error.

I also tried adding 2x <column>#cspan</column> That didn't work out.

Do you know how to accomplish it?

Another small question is, is there a function which returns the number of columns. I want to disable sorting on the last column, but since i don't know how many colums i'll get, i just need the last one.


Thanks


Answer posted by Support on Mar 18, 2008 10:07
>>But when i leave out the <column> tags i get an error.
When configuration initialized from XML <column> tags are mandatory

>>I also tried adding 2x <column>#cspan</column> That didn't work out.
Actually this is must work

     <column width="150" type="ro" align="left" sort="str">E-mail adres</column>
        <column width="150" type="ro" align="left" sort="str">Groep(en)</column>
        <column width="150" type="ro" align="right" sort="str">Naam</column>
        <column width="150" type="ro" align="right" sort="str">Beroep</column>
        <column width="150" type="ro" align="right" sort="str">Opties</column>
        <column width="150" type="ro" align="right" sort="str">#cspan</column>
        <column width="150" type="ro" align="right" sort="str">#cspan</column>

please be sure that there is no extra whitespaces around #cspan

>>Another small question is, is there a function which returns the number of columns.
    mygrid.getColumnCount();