cancel
Showing results for 
Search instead for 
Did you mean: 

Autofit for crosstab

Former Member
0 Kudos

Hi all,

I'm using a crosstab in design studio and I put it in a cell of a grid_layout. I want to make it fill the cell and when the device changes it can be autofit for the screen but there is always some blank area.

Is there anyway available to make the crosstab fill the cell?

Thanks & Best regards,

Shuang

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Has anyone figured out how to do this?  I thought I could do it by figuring out the width of the crosstab itself and doing some division to adjust the col widths from there, but alas Design Studio in it's infinite wisdom doesn't let me get the width of the crosstab if it's set to auto (returns -1). lol  No idea why that is, I'm sure it knows how wide it actually is after the resizing, why is there no way to query that?

Former Member
0 Kudos

The biggest problem is that if it's set to auto it will return -1.

Karol-K
Advisor
Advisor
0 Kudos

Hi Shuang,

the maximize button is correct, this is changing the alignment property to all margins set to "0 px", this means this component will be now bound on left/right/top/bottom. From then, it takes practically the size of the parent contained.

Keep in mind, you define which size the component CAN take at maximum, not which size it MUST take. The content is shown based on the longest cell text (and you can resize it by double click).

If you really want to maximize the crosstab, you can use the property "Column Widths" in crosstab (or via script) where you can specify the width in pixels for each column, but of course then it is unsynchronized with the dynamic auto sizing.

Karol

Karol-K
Advisor
Advisor
0 Kudos

check also the thread and the AutoFill option.

Former Member
0 Kudos

Hi Karol,

I'm sorry I didn't express my idea very well. I mean that is there any way to make the column width and row height change automatically?

Thanks,

Shuang

Karol-K
Advisor
Advisor
0 Kudos

On which event do you want to make the resize "automatically"?

you can try to set all widths, but this will work only if you know the maximal size. Here some idea how to change the width, but not sure if this will help you.

  var array = [0,1,2,3,4,5,6,7,8,9,10];

 

  CROSSTAB_1.resetAllColumnWidths();

  array.forEach(function(element, index) {

      CROSSTAB_1.setColumnWidth(index, 200);

  });

for the height, the only way to adjust the height would be some CSS work.

TammyPowlas
Active Contributor
0 Kudos

You could try to the maximize button - see screen shot below:

Former Member
0 Kudos

Hi Tammy,

I'm sorry I didn't express my idea very well. I mean that is there any way to make the column width and row height change automatically?

Thanks,

Shuang