Project

General

Profile

Actions

Support #3519

open

How to add Wcheckbox on Table header row

Added by Anonymous over 9 years ago. Updated over 9 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
08/07/2014
Due date:
% Done:

0%

Estimated time:

Description

We want to display checkbox in a Table header column as its item instead of String. I tried using WStandardItem as WCheckbox. But it still renders them as String/Object.

Requirement is to select all the checkboxes with in a column on a table when user selects checkbox on a header row.

For reference attached image file with highlighted by orange colour.

We are using model.setHeaderData(index, Orientation.Horizontal, value) line of code to Set header data for a column.

Please assist to add checkbox on header row and how to get action listener if user selected/unselected checkbox.


Files

dashboard.png (5.97 KB) dashboard.png Anonymous, 08/07/2014 05:30 PM
Actions #1

Updated by Wim Dumon over 9 years ago

  • Status changed from New to Resolved

My apologies for the pseudo-code. To check/uncheck the checkbox in the header:

 model.setHeaderData(index, Orientation.Horizontal, value, CheckStateRole);

To show/hide the checkbox in the header:

 model.setHeaderFlags(index, Orientation.Horizontal, HeaderIsUserCheckable);

To react when changed, reimplement setHeaderData and do what needs to be done when the CheckStateRole data of the first column is changed.

Best regards,

Wim.

Actions

Also available in: Atom PDF