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

add button dynamically in the same row

Hello,

basically I have a data table that I create a report with it and then I'm trying to add buttons to it dynamically in the same row, but the buttons go under the table

this is what i get

 

itzikd_0-1618148451124.png

 

what i would like is "button #1" to be after "number 2" in the end of the table

 

 

myPlatform = New Window( "name",
	H List Box(
		V List Box( bb = Col Box( "buttons" ), );
		V List Box( myDispObj = dtSum << getAsReport );
	)
);

rowList = myDispObj[Number Col Box( 1 )] << Get As Matrix;
rowList = As List( rowList );

bblist = {};
For( i = 1, i <= N Items( rowList ), i++,
	bb_expr = Eval Insert( "\[bblist[i] = buttonbox("Button #" || char(i), doSomething(^i^))]\" );
	Eval( Parse( bb_expr ) );
	myPlatform << append( bblist[i] );
);
2 ACCEPTED SOLUTIONS

Accepted Solutions
Georg
Level VII

Re: add button dynamically in the same row

You need to append the buttons to the H List Box,

and btw the elements of the H List Box need to be separated by colons ",".

BR

 

Georg_0-1618177152078.png

 

Georg

View solution in original post

Re: add button dynamically in the same row

This example shows another approach that gives you more control.

 

button in row.PNG

 

Adapted from example given in the Scripting Index entry for Display Boxes > Col Box:

 

Names Default To Here( 1 );

New Window( "Button in Row",
	exx = 1;
	exy = 4;
	exz = 8;
	Table Box(
		String Col Box( "strings", {"x", "y", "z"} ),
		Number Col Box( "values", {exx, exy, exz} ),
		Col Box(
			"buttons",
			Button Box( "Button 1" ),
			Button Box( "Button 2" ),
			Button Box( "Button 3" )
		)
	);
); 

 

View solution in original post

2 REPLIES 2
Georg
Level VII

Re: add button dynamically in the same row

You need to append the buttons to the H List Box,

and btw the elements of the H List Box need to be separated by colons ",".

BR

 

Georg_0-1618177152078.png

 

Georg

Re: add button dynamically in the same row

This example shows another approach that gives you more control.

 

button in row.PNG

 

Adapted from example given in the Scripting Index entry for Display Boxes > Col Box:

 

Names Default To Here( 1 );

New Window( "Button in Row",
	exx = 1;
	exy = 4;
	exz = 8;
	Table Box(
		String Col Box( "strings", {"x", "y", "z"} ),
		Number Col Box( "values", {exx, exy, exz} ),
		Col Box(
			"buttons",
			Button Box( "Button 1" ),
			Button Box( "Button 2" ),
			Button Box( "Button 3" )
		)
	);
);