码迷,mamicode.com
首页 > 其他好文 > 详细

获取表的选择行

时间:2015-04-21 20:06:00      阅读:171      评论:0      收藏:0      [点我收藏+]

标签:

 1     public static int getSelectedRowIndex(KDTable table)
 2  {
 3    int[] selectRows = KDTableUtil.getSelectedRows(table);
 4    int selectIndex = -1;
 5    if ((selectRows != null) && (selectRows.length > 0))
 6    {
 7      selectIndex = selectRows[0];
 8    }
 9    return selectIndex;
10  }
11  public static List getSelectRowIndexes(KDTable table)
12  {
13    List rows = new ArrayList();
14    if ((table.getRowCount() > 0) && (table.getSelectManager().size() != 0)) {
15      for (int i = 0; i < table.getSelectManager().size(); i++) {
16        KDTSelectBlock block = table.getSelectManager().get(i);
17        if ((block != null) && (block.getMode() == 4))
18        {
19          block.setTop(0);
20        }
21        int beginRow = getBeginRow(block, table);
22        int endRow = getEndRow(block, table);
23        for (int r = beginRow; r <= endRow; r++) {
24          rows.add(new Integer(r));
25        }
26      }
27    }
28    return rows;
29  }

 

获取表的选择行

标签:

原文地址:http://www.cnblogs.com/cyhj/p/4444952.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!