Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted on Apr 14, 2008 03:05
open dhtmlx forum
Complex headers when column tag is used

Hi,
I'm using the below mentioned format to display header of the table


<head>
for i=1 to 10
<column rowspan="1"> </column>
<column rowspan="2"> </column>
.
.
.
<column rowspan="2"> </column>
next
for i=1 to 10
<column rowspan="1"> </column>
<column rowspan="1"> </column>
.
.
.
<column rowspan="1"> </column>
next
</head>

Here i want the header to be displayed in two different rows when the rowspan=1 and when the rowspan=2 the rows must be merged. But, the result what i'm getting is that all the values are being displayedd in a single row with the rowspan=2. Could you please suggest me on how to proceed to acheive the required functionality.
Answer posted by Support on Apr 14, 2008 06:28
Init from XML doesn't support simple format to represent multi-line headers, basically the correct code will be similar to next

<rows>
    <head>
        <column>1</column>
        <column>2</column>
        <column>3</column>
        <column>4</column>
        <column>5</column>
        <column>6</column>
        <column>7</column>
        <column>8</column>
        <column>9</column>
        <column>10</column>
            <afterInit>
                <call command="attachHeader"><param>1.1,#rspan,#rspan,#rspan,#rspan,#rspan,#rspan,#rspan,#rspan,#rspan</param></call>
            </afterInit>
    </head>
    ....
Answer posted on Apr 14, 2008 07:04
But the values for the header is coming from the datadase. So we can't specify the exact number of columns to pass the param. Again the the two set of values comes from two For loops. The number of columns are not static. That is why i tried to differentiate the values with the rowspan, so that the values falls in sequence and also with appropriate rowspan. But it is not working for me.For details kindly go through the code once again which was sent by me earlier. Any suggestion on this would be of great help for me.
Answer posted by Support on Apr 14, 2008 07:10
There is no technical issues to generate the described XML dynamically as well, it just not so clear as it may be

<head>
for i=1 to 10
    <column> </column>
    <column> </column>
    ...
    <column > </column>
next

var temp
for i=1 to 10
    temp.push("")
    temp.push("#rspan")
    ...
    temp.push("#rspan")
next
echo " <afterInit><call command="attachHeader"><param>" temp.join(",") "</param></call></afterInit>"
</head>

Answer posted on Apr 15, 2008 04:04

Here the header will not be having the spans alll the time. Only at times when certain conditions are met then only the rows are split.

The syntax format what i'm using is given below.

Am i going through the right format.?

<head>
for i=1 to 10
Response.write "<column rowspan="1"> data</column> "
Response.write "<column rowspan="2"> data</column> "
.
.
.
Response.write "<column rowspan="2"> data</column> "
next

if() then
for i=1 to 10

.

.

.

'Somevalue might be anything (blank space/special character....)

sTotal =SomeValue
next 

end if

'Response.Write "<afterinit>"

'Response.Write "<call command=""attachHeader"">"

Response.Write "<param>" & sTotal & " </param>"

Response.Write "" & sTotal & "" '

Response.Write "</call>"

'Response.Write "</head>"

'Response.Write "</afterinit>"

.

.

.

.

 

<settings>

.

.

</settings>

<beforeinit>

</beforeinit>

 

Answer posted on Apr 15, 2008 04:23
Here the header will not be having the spans alll the time. Only at times when certain conditions are met then only the rows are split.

The syntax format what i'm using is given below.

Am i going through the right format.?

I tried several ways to implement but was not successful. Please reply ASAP

<head>
for i=1 to 10
Response.write "<column rowspan="1"> data</column> "
Response.write "<column rowspan="2"> data</column> "
.
.
.
Response.write "<column rowspan="2"> data</column> "
next

if() then
for i=1 to 10

.

.

.

'Somevalue might be anything (blank space/special character....)

sTotal =SomeValue
next 

end if

'Response.Write "<afterinit>"

'Response.Write "<call command=""attachHeader"">"

Response.Write "<param>" & sTotal & " </param>"

Response.Write "" & sTotal & "" '

Response.Write "</call>"

'Response.Write "</head>"

'Response.Write "</afterinit>"

.

.

.

.

 

<settings>

.

.

</settings>

<beforeinit>

</beforeinit>

 

Answer posted by Support on Apr 15, 2008 04:29
The rowspans in header defined by #rspan as value of cell which need to be included in rowspan, the usage of rowspan attributes has not any sense.
Answer posted on Apr 15, 2008 22:26

Still i'm facing the problem in displaying the headers with rowspan. Could you please help me by sending the correct syntax along with the format which i have mentioned.

<head>
for i=1 to 10
Response.write "<column> data</column> "
Response.write "<column> data</column> "
.
.
.
Response.write "<column> data</column> "
next

if() then
for i=1 to 10

.

.

.

'Somevalue might be anything (blank space/special character....)

sTotal =SomeValue (Either the value or the #rspan)
next 

end if

Response.Write "<afterinit>"

Response.Write "<call command=""attachHeader"">"

Response.Write "<param>" & sTotal & " </param>"

Response.Write "" & sTotal & "" '

Response.Write "</call>"

Response.Write "</head>"

Response.Write "</afterinit>"

'Contents of the grid defined

.

.

.

 

<settings>

.

.

</settings>

<beforeinit>

</beforeinit>

Answer posted by Support on Apr 16, 2008 02:54
The code looks correct, please provide exact XML code generated by it , if it cause some problems for you