Skip to content

Version 1.22.1

Choose a tag to compare

@JuicyDragon JuicyDragon released this 05 Jan 18:16
· 2 commits to master since this release

Added a way to hide filtering and status controls on DynamicTable, in case you want a simpler table control. Usage from Ruby looks something like below. Note the methods setShowFilterControls and setShowStatusLabel.

dynamic_table_tab = dialog.addTab("dynamic_table_tab","Dynamic Table")

# Define the headers
headers = [
	"Name", "Color", "Age"
]

# Define some data to display
values = [
	{:name => "Ziggy", :color => "Grey", :age => 10},
	{:name => "Ringo", :color => "Grey", :age => 10},
	{:name => "Scrappy", :color => "Black", :age => 5},
	{:name => "Dolly", :color => "Black", :age => 1},
]

dynamic_table_tab = dialog.addTab("dynamic_table_tab","Dynamic Table (Hide Some)")

# Need to supply a callback which can fetch field values from a given record in the data
# and potential save values back assuming you wish the table to be editable
dynamic_table_tab.appendDynamicTable("dynamic_table","Dynamic Table",headers,values) do |record,column|
	case column
	when 0
		next record[:name]
	when 1
		next record[:color]
	when 2
		next record[:age].to_s
	else
		next "Unknown"
	end
end

dynamic_table = dialog.getControl("dynamic_table")

# Hide both filter controls and status label for table-only view
dynamic_table.setShowFilterControls(false)
dynamic_table.setShowStatusLabel(false)