-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathExampleGrid1.qml
More file actions
30 lines (27 loc) · 832 Bytes
/
Copy pathExampleGrid1.qml
File metadata and controls
30 lines (27 loc) · 832 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import QtQuick 2.0
DataTable {
id: tableId
property alias ageColumn: ageColumnId
columns: [
DataColumn {field:"name"; label: "First Name"},
DataColumn {field:"lastName"; label: "Last Name"},
DataColumn {
id: ageColumnId
field:"age"
type:"number"
cell: DefaultCell {
color: row.age > 20 ? "blue" : "red"
}
}
]
rows: [
{lastName: "Bobberson", name:"bob", age: 4},
{lastName: "be", name: "jo", age: 6},
{lastName: "ington", name: "Alex", age: 50},
{lastName: "Butterfly", name: "Rebekah", age: 22},
]
onColumnHeaderClicked: {
print("sorting column: " + column.name);
}
onCellClicked: print("clicked cell:" + column.name + "|" + row.name)
}