From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

[Beginner] Sorting Data from table

Hi,

I'd like to sort a table of string when the user click on the header or a button
like windows explorer works.
Perhaps someone has already made something like that.

Thanks
0 Kudos
Message 1 of 2
(3,759 Views)
"y.leroux" wrote:

> I'd like to sort a table of string when the user click on the header or a button
> like windows explorer works.
> Perhaps someone has already made something like that.

The user interface for this might be difficult, because this sort of functionality
is not directly built into the LabVIEW Table control or the array control. However,
an algorithm for sorting a 2D array by one of its columns is available (among other
places, I'm sure) in the Example Programs Database at the NI Web site:

http://digital.ni.com/explprog.nsf/websearch/c28f4cd330ff2be5862567b70072858a

To complete your task, you'd need to either add some buttons to call this logic and
rewrite the table value using a local variable, or use attribute nodes with your
table that recognize w
hen a user has clicked on a "sort" cell and calls the logic.

Best Regards,
John Lum
National Instruments
0 Kudos
Message 2 of 2
(3,759 Views)