Get selected cells of pivot table

This is the forum for JIDE Common Layer which is open sourced at https://github.com/jidesoft/jide-oss. Please note, JIDE technical support doesn't monitor this forum as often as other forums. Please consider subscribe for technical support for JIDE Common Layer so that you can use customer only forum to get a timely response.

Moderator: JIDE Support

Forum rules
Community driven forum for open source JIDE Common Layer. JIDE technical support doesn't monitor this forum as often as other forums. If you only use JIDE Common Layer, please consider subscribing for technical support for JIDE Common Layer so that you can use customer only forum to get a timely response.

Get selected cells of pivot table

Postby wolfgang » Fri Feb 24, 2012 2:29 am

I use this code, to get selected cells in pivot table:
Code: Select all
            int rowIndexStart = dataTable.getSelectedRow();
            int rowIndexEnd = dataTable.getSelectionModel().getMaxSelectionIndex();
            int colIndexStart = dataTable.getSelectedColumn();
            int colIndexEnd = dataTable.getColumnModel().getSelectionModel().getMaxSelectionIndex();
            for (int r = rowIndexStart; r <= rowIndexEnd; r++) {
                for (int c = colIndexStart; c <= colIndexEnd; c++) {
                    if (dataTable.isCellSelected(r, c)) {
                        System.out.println( r + " " + c);
                    }
                }
            }



On <MouseClick + Ctrl> every cells in every rows are detected. When I use <Key Arrow Left/Right + Shift> only cells of one row are detected. What is wrong with my code above or what alternative I have, please?
wolfgang
 
Posts: 25
Joined: Fri Dec 09, 2011 2:26 am

Get selected cells of pivot table

Postby wolfgang » Fri Feb 24, 2012 3:42 am

Additional: It seems, only cells of that row are detected with code above, which has the focused cell (dashed line border). Is there another way to get selected Cells of DataTable by <KeyEvent + Shift>?
wolfgang
 
Posts: 25
Joined: Fri Dec 09, 2011 2:26 am

Re: Get selected cells of pivot table

Postby JIDE Support » Fri Feb 24, 2012 8:39 am

By default, DataTable uses non-contiguous cell selection. Please use getTableSelectionModel() instead to retrieve the selection information.

Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am

Re: Get selected cells of pivot table

Postby wolfgang » Thu Mar 01, 2012 12:40 am

thanks a lot. :D
wolfgang
 
Posts: 25
Joined: Fri Dec 09, 2011 2:26 am


Return to JIDE Common Layer Open Source Project Discussion (Community Driven)

Who is online

Users browsing this forum: No registered users and 13 guests