Subscribe Bookmark RSS Feed

How to "lock" single column width in JMP

sadhammer

Community Trekker

Joined:

Sep 14, 2013

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

3 REPLIES
connect01

Staff

Joined:

Oct 23, 2012

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);

sadhammer

Community Trekker

Joined:

Sep 14, 2013

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

Joined:

Jun 23, 2011

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 )

);