Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic How to change width of specific column? (Read 1302 times)
Brarord
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 18
Joined: Dec 30th, 2019
How to change width of specific column?
Jan 1st, 2020 at 6:46am
Print Post  
Hi!
I am trying to change width of my columns, because it is too short and cuts off some of the text.
This is how it looks:


Here is my code:
Code (Javascript)
Select All
function createTable() {
    // create a new table with the specified extent
    var table = diagram.getFactory().createTableNode(
        15 + tableCount * 3, 15 + tableCount * 4, 50, 60);
    table.setText("Table" + tableCount++);
    table.redimTable(4, 0);
    table.setScrollable(true);
    table.setConnectionStyle(ConnectionStyle.Rows);

    // set the first column to resize with the table

    table.getColumn(0).columnStyle = ColumnStyle.AutoWidth;
    generateSQL();} 


Can someone give me example how to properly change that width? I tried several tips from other topics, but they didn't work.


Regards,
poor student Undecided
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3147
Joined: Oct 19th, 2005
Re: How to change width of specific column?
Reply #1 - Jan 1st, 2020 at 9:40am
Print Post  
Happy 2020!

You could set table.getColumn(c).width to a fixed width, or table.getColumn(c).columnStyle to ColumnStyle.AutoWidth to make column occupy space left unfilled by other fixed-width columns. You might also try the resizeToFitText method.

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
Brarord
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 18
Joined: Dec 30th, 2019
Re: How to change width of specific column?
Reply #2 - Jan 1st, 2020 at 10:04pm
Print Post  
Thanks!!! Slavcho you are saving my engineering work Grin

Happy new year! :]


Regards,
poor student Cool
« Last Edit: Jan 2nd, 2020 at 7:00am by Brarord »  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint