TableView Header

Hey,

how is it possible to get the onClick-Event of a TableView-Header.

Cheers,
Domi

1 Like

Missed this :slight_smile:

What backend? I mean, composite / native?

Ian

In this case i used the html5-backend and composite.

Cheers,
Domi

Something like this should be fine then:

http://haxeui.org/builder/?tahtts

Note, this is using script, rather than haxe code, but the same concept applies regardless.

Its just a component on the component tree, so you can find it at will (if it were inside a custom component with a @:build macro then it would automatically be there :wink: ).

I’m also interested in this but I don’t think the link is working anymore.

Any possibility of pasting the code directly here?

Many thanks

So, i dont remember the code used, but i suppose something like this: http://haxeui.org/builder/?465bcf1b

<vbox style="padding:5px;">
	<tableview width="400" height="200">
		<header width="100%">
			<column id="colA" text="Column A" onclick="trace(1)" />
			<column id="colB" text="Column B" width="200" onclick="trace(2)" />
			<column id="colC" text="Column C" width="100%" onclick="trace(3)" />
		</header>

		<data>
			<item colA="Item 1A" colB="Item 1B" colC="Item 1C" /> 
			<item colA="Item 2A" colB="Item 2B" colC="Item 2C" /> 
			<item colA="Item 3A" colB="Item 3B" colC="Item 3C" /> 
			<item colA="Item 4A" colB="Item 4B" colC="Item 4C" /> 
			<item colA="Item 5A" colB="Item 5B" colC="Item 5C" /> 
			<item colA="Item 6A" colB="Item 6B" colC="Item 6C" /> 
			<item colA="Item 7A" colB="Item 7B" colC="Item 7C" /> 
			<item colA="Item 8A" colB="Item 8B" colC="Item 8C" /> 
			<item colA="Item 9A" colB="Item 9B" colC="Item 9C" /> 
		</data>
	</tableview>
</vbox>
1 Like