0

I am using a UITABLE to display some data. After displaying the table i want to add a logical column to the end of the table. And depending on columns checked or unchecked future actions are taken. Any idea Guys?

4

1 回答 1

2

一个例子:

%# initial table
c1 = rand(10,3);
h = uitable('Units','normalized', 'Position',[0 0 1 1], 'Data',c1);

%# add new column of check boxes
c2 = c1(:,1)>0.5;
set(h, 'Data',[num2cell(c1) num2cell(c2)], ...
    'ColumnFormat',[repmat({[]},1,size(c1,2)),'logical'], ...
    'ColumnEditable',[false(1,size(c1,2)),true])

截屏

您可能想要处理CellEditCallback执行自定义操作。

于 2012-07-03T20:45:24.897 回答