uitable: Can the headers be made clickable?
Mostrar comentarios más antiguos
I would like to sort the entries in a table by by clicking on the column header for the variable I want to sort. Is there a way to make the headers clickable in uitable?
Respuestas (2)
Walter Roberson
el 23 de Feb. de 2011
1 voto
... '<HTML><A HREF="matlab:sort_by_col1">'
In theory. In practice I had trouble with this sort of thing in the cell entries.
4 comentarios
Andrew Newell
el 23 de Feb. de 2011
Walter Roberson
el 23 de Feb. de 2011
uitable('Data',{1 2; 3 4;5 6}, 'ColumnName', {'<HTML><A HREF="matlab:disp(''col1'')">A</A>', '<HTML><A HREF="matlab:disp(''col2'')">B</A>'})
This will produce the appearance of hyperlinks in the column names, but at least in 2008b I cannot get the links to function, and there is no indication that the link is clickable.
There is an undocumented property of uitable (in 2008b anyhow) called Sortable, default 'off', can be set to 'on'. It doesn't appear to do anything.
People have asked for the same thing in the past; the responses I found have all indicated that it cannot be done. But I didn't read through Yair's site.
Andrew Newell
el 23 de Feb. de 2011
Walter Roberson
el 23 de Feb. de 2011
sort_by_col1 would be a call that matlab would execute due to the matlab: URI prefix.
disp('col1') is a trial action just to see if the link is working.
Andrew Newell
el 23 de Feb. de 2011
0 votos
Categorías
Más información sobre Loops and Conditional Statements en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!