I placed a tech support ticket to get the answer for this simple question, since there are no other post that are relevant to this issue. I decided to share the answer here with the JMP community so others could benefit as well:
My Question:
If it’s possible, I would like to know if I can perform the following on a TableBox:
GuiWindow = NewWindow("SMS1");
theBox = TableBox(
stringColBox("State",{"Florida", "Texas", "Main", "California"}),
NumberColBox("Width",{45,66,88,13}),
NumberColBox("Length",{67,34,1,78}),
NumberColBox("Depth",{13,65,32,56}));
theBox << Set Selectable Rows(1);
GuiWindow << Append(theBox);
Tech support answer (Thanks Marcos!)
GuiWindow = NewWindow("SMS1");
theBox = TableBox(
stringColBox("State",{"Florida", "Texas", "Main", "California"}),
NumberColBox("Width",{45,66,88,13}),
NumberColBox("Length",{67,34,1,78}),
NumberColBox("Depth",{13,65,32,56}));
theBox << Set Selectable Rows(1);
GuiWindow << Append(theBox);
dt = theBox << Make into Data Table( invisible );
rs = dt << Get Rows Where( :Length > :Depth );
theBox << Set Selected Rows( rs );
theBox << Set Selected Row Color( "red" );
I hope this helps. Please let me know what other questions you have.
Regards
Marcos
Tech support answer (Thanks Marcos!)
GuiWindow = NewWindow("SMS1");
theBox = TableBox(
stringColBox("State",{"Florida", "Texas", "Main", "California"}),
NumberColBox("Width",{45,66,88,13}),
NumberColBox("Length",{67,34,1,78}),
NumberColBox("Depth",{13,65,32,56}));
theBox << Set Selectable Rows(1);
GuiWindow << Append(theBox);
dt = theBox << Make into Data Table( invisible );
rs = dt << Get Rows Where( :Length > :Depth );
theBox << Set Selected Rows( rs );
theBox << Set Selected Row Color( "red" );
I hope this helps. Please let me know what other questions you have.
Regards
Marcos
This script leaves the table box open to further selection by the user as far as it goes. If all you want to do is highlight particular cases in the table, then follow with this message:
theBox << Set Selectable Rows( 0 );
You won't lose the coloring.
Hi Mark,
I tried your suggestion, but I lose the coloring in the process. Here is the behavior that I'm noticing, let me know you can reproduce it as well (I'm using JMP 11 Pro and Standard).
If I place the line 'theBox << Set Selectable Rows(0);' at the end, I lose the coloring (the rows are no longer selected).
GuiWindow = NewWindow("SMS1");
theBox = TableBox(
stringColBox("State",{"Florida", "Texas", "Main", "California"}),
NumberColBox("Width",{45,66,88,13}),
NumberColBox("Length",{67,34,1,78}),
NumberColBox("Depth",{13,65,32,56}));
theBox << Set Selectable Rows(1);
GuiWindow << Append(theBox);
dt = theBox << Make into Data Table( invisible );
rs = dt << Get Rows Where( :Length > :Depth );
theBox << Set Selected Rows( rs );
theBox << Set Selected Row Color( "red" );
theBox << Set Selectable Rows(0);
If I place the line anywhere else after declaring the theBox object, the rows are selected, and colored as expected, but the user can select other rows, and thus change the initial output.
GuiWindow = NewWindow("SMS1");
theBox = TableBox(
stringColBox("State",{"Florida", "Texas", "Main", "California"}),
NumberColBox("Width",{45,66,88,13}),
NumberColBox("Length",{67,34,1,78}),
NumberColBox("Depth",{13,65,32,56}));
theBox << Set Selectable Rows(1);
GuiWindow << Append(theBox);
theBox << Set Selectable Rows(0);
dt = theBox << Make into Data Table( invisible );
rs = dt << Get Rows Where( :Length > :Depth );
theBox << Set Selected Rows( rs );
theBox << Set Selected Row Color( "red" );
Tech support answer (Thanks Marcos!)
GuiWindow = NewWindow("SMS1");
theBox = TableBox(
stringColBox("State",{"Florida", "Texas", "Main", "California"}),
NumberColBox("Width",{45,66,88,13}),
NumberColBox("Length",{67,34,1,78}),
NumberColBox("Depth",{13,65,32,56}));
theBox << Set Selectable Rows(1);
GuiWindow << Append(theBox);
dt = theBox << Make into Data Table( invisible );
rs = dt << Get Rows Where( :Length > :Depth );
theBox << Set Selected Rows( rs );
theBox << Set Selected Row Color( "red" );
I hope this helps. Please let me know what other questions you have.
Regards
Marcos