cancel
Showing results for 
Search instead for 
Did you mean: 

merge cells at runtime in Adobe Form

0 Kudos

Help.

I have 6 columns in a table .

I need to write a script in adobe form to check the value of the 5th column

if 5th column = 'T' then I need merge 1th,2th,3th columns

If 5th column = ' ' then do nothing

I write JavaScript

data.#subform[0].TABLE.DATA::initialize


if ( this.COLUMN5.rawValue == "T" )
{
this.COLUMN1.colSpan = "3" ;
}

The cell's merged but not correct. In the row with column = 'T' appear the new columns.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

try same thing in DOCREADY event. bcoz u r changing the form alignment. else do one more thing is hide the three cells and

increase the 5th cell width. but if u want to change alignment of form u should write in DOC READY event.

0 Kudos

I hided columns.

this.column2.presence = "hidden";

this.column3.presence = "hidden";

...

but I don't know method to increase column1 (cell)

chintan_virani
Active Contributor
0 Kudos

Well you are on right track. Just use the code in your first post and second post for complete solution.

I tried with a simple table with 1 row and below is the JavaScript code I used in the initialize event of Subform:-

Table1.Row1.Cell5.rawValue = "T";
if(Table1.Row1.Cell5.rawValue == "T")
{
	Table1.Row1.Cell1.colSpan = "3" ;
	Table1.Row1.Cell2.presence = "hidden";
	Table1.Row1.Cell3.presence = "hidden";
}

0 Kudos

thank you very much Chintan Virani

-


data.Subform1.table1.DATA::initialize: - (JavaScript, client) -


if (this.col1.rawValue == "T")

{

this.col1.colSpan = "3";

this.col2.presence = "hidden";

this.col3.presence = "hidden";

}

chintan_virani
Active Contributor
0 Kudos

Well actually you need to pat your own back because you only found the solution (in parts), I just helped you to glue both parts to solve the issue.

0 Kudos

Could I ask a little question?

I'd like align (to right) text in merge cell1. I know static in pallete Paragraph-Align.

I need dynamic align but could'not find method

chintan_virani
Active Contributor
0 Kudos

Well you can do it via coding as well as shown below:-

this.col1.para.hAlign = "right";

0 Kudos

thanks

Answers (0)