cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
optflow
Level II

How to "lock" single column width in JMP

Greetings,

I have a single column (Data Type > Character) in JMP file (using 10 Pro) that requires extremely long character strings. Unlike Excel, I cannot find a simple way to "lock" the column width, which results in auto-resizing the column to massive widths upon reopening the file, entering new text, etc. Note: I do not want to use the actual Lock feature (under Column Info), as I need to constantly make updates.

Thank you, Andrew

2 ACCEPTED SOLUTIONS

Accepted Solutions
Hui_Di
Staff

Re: How to "lock" single column width in JMP

It seems that you can't do it from UI. However, from JSL, we can control the column display width. I am using JMP11 and not sure if GetDisplayWidth and SetDisplayWidth commands are in JMP10. See script below. The display width reduced from default 70 to 35.

//JSL

dt = New Table( "test", Add Rows( 1 ),

        New Column( "Col1", Character,Formula( Repeat( "a", 100 ) )),

);

w=:Col1 << GetDisplayWidth;

:Col1 <<SetDisplayWidth(w/2);

View solution in original post

ms
Super User (Alumni) ms
Super User (Alumni)

Re: How to "lock" single column width in JMP

You can use a "On Open" table script that will be run each time.

Run the code below to add the table script (or add it manually) to your table. Make sure to first change the column name to the name of your column and pick a display width that fits your data.

Current Data Table() << New Script(

  "OnOpen",

  :Name( "Col1" ) << Set Display Width( 400 )

);

View solution in original post

3 REPLIES 3
Hui_Di
Staff

Re: How to "lock" single column width in JMP

It seems that you can't do it from UI. However, from JSL, we can control the column display width. I am using JMP11 and not sure if GetDisplayWidth and SetDisplayWidth commands are in JMP10. See script below. The display width reduced from default 70 to 35.

//JSL

dt = New Table( "test", Add Rows( 1 ),

        New Column( "Col1", Character,Formula( Repeat( "a", 100 ) )),

);

w=:Col1 << GetDisplayWidth;

:Col1 <<SetDisplayWidth(w/2);

optflow
Level II

Re: How to "lock" single column width in JMP

Thank you for the response. Unfortunately, I have almost no experience with JSL scripts. Can you please explain how to go about inserting this script into a column? My attempts so far have generated errors or simply failed to do anything.

ms
Super User (Alumni) ms
Super User (Alumni)

Re: How to "lock" single column width in JMP

You can use a "On Open" table script that will be run each time.

Run the code below to add the table script (or add it manually) to your table. Make sure to first change the column name to the name of your column and pick a display width that fits your data.

Current Data Table() << New Script(

  "OnOpen",

  :Name( "Col1" ) << Set Display Width( 400 )

);