Hi everyone,
Need your help to solve the problems below (code attached).
1. I have a widget that users can key in info and then the "Submit" button is hit, the data is saved into the pre-defined data table successfully. However, I can not make the display table on the widget get updated.
2. For example, users submit 5 rows of data and the second row is transcripted incorrectly then I want to create a "Delete" button but still have no ideas how to pick the right row to delete (on widget).
data_input = Expr(
dt = New Table( "Data Table",
Invisible,
New Column( "Sequence",
Numeric,
Formula(Sequence(1,99,1))
),
New Column( "Col1",
Numeric,
"Continuous",
Format( "d/m/y h:m:s" ),
Input Format( "d/m/y h:m:s" ),
),
New Column( "Col2",
Character,
"Nominal"
),
New Column( "Col3",
Character,
),
New Column( "Col4",
Character,
),
New Column( "Col5",
Character,
"Nominal"
),
New Column( "Col6",
Character,
"Nominal"
),
New Column( "Col7",
Character,
"Nominal"
),
New Column( "Col8",
Character,
"Nominal"
),
New Column( "Col9",
Numeric,
Format( "h:m" )
),
New Column( "Col10",
Numeric,
Format( "h:m" )
),
);
);
buffer = Expr(
Data1 = {"A", "B", "C", "D", "E", "F"};
co1 = Data1[nw["t2"]];
);
graphic = Expr(
nw = New Window( " Records ",
<<MODAL></MODAL>
Good Day,
@Black_Wheel ,
There are several methods to do this:
- dt << Get As Report , you the scripter needs update the report with each addition and for a deletion, script get the selected row, delete from the underlying table and update the display. The report is independent of the table, and teh scripter manages the view.
- dt << New Data Box() the view is linked to the data table. So to delete or edit a row the user just deletes or edits it.
There is another method creating a Table Box using DataTableColBox() however, I encountered an error when using Get Selected Rows(), which I have reported to JMP.
I have attached a modified version of your script using the first method dt << Get As Report. Note some cahnges:
- commented out << Modal and << Return Results, the invisible table seems to be the result.
- added a VScrollBox() container for the display table
- made selected row color red (see screen shot below)
