Implement Quick Filters
This commit is contained in:
@@ -3,78 +3,69 @@ import QtQuick.Layouts
|
||||
import QtQuick.Controls
|
||||
import Qt.labs.qmlmodels
|
||||
|
||||
Item {
|
||||
ColumnLayout {
|
||||
function viewCriterion(criterion) {
|
||||
business_model.viewCriterion(criterion.text);
|
||||
}
|
||||
|
||||
anchors.fill: parent
|
||||
|
||||
Component.onCompleted: customersStack.pop()
|
||||
|
||||
SearchBar {
|
||||
id: searchBar
|
||||
RowLayout {
|
||||
Layout.fillWidth: true
|
||||
Layout.horizontalStretchFactor: 1
|
||||
spacing: Dimensions.l
|
||||
|
||||
anchors.margins: 9
|
||||
}
|
||||
SearchBar {
|
||||
}
|
||||
|
||||
Button {
|
||||
id: addCustomer
|
||||
QuickFilter {
|
||||
onSelectedChanged: (name) => {
|
||||
business_model.viewCriterion(name)
|
||||
}
|
||||
|
||||
anchors.right: parent.right
|
||||
icon.source: "qrc:/images/PlusCircle.svg"
|
||||
text: qsTr("Kunde hinzufügen")
|
||||
model: ListModel {
|
||||
ListElement {
|
||||
name: "Alle"
|
||||
text: qsTr("Alle")
|
||||
selected: true
|
||||
}
|
||||
ListElement {
|
||||
name: "showProvider"
|
||||
text: qsTr("Interessent")
|
||||
selected: false
|
||||
}
|
||||
ListElement {
|
||||
name: "showClientele"
|
||||
text: qsTr("Kunde")
|
||||
selected: false
|
||||
}
|
||||
ListElement {
|
||||
name: "showProvider"
|
||||
text: qsTr("Lieferant")
|
||||
selected: false
|
||||
}
|
||||
ListElement {
|
||||
name: "showFinished"
|
||||
text: qsTr("Erledigt")
|
||||
selected: false
|
||||
}
|
||||
}
|
||||
}
|
||||
Button {
|
||||
id: addCustomer
|
||||
|
||||
onClicked: appLoader.source = "AddCustomer.qml"
|
||||
Layout.alignment: Qt.AlignRight
|
||||
icon.source: "qrc:/images/PlusCircle.svg"
|
||||
text: qsTr("Kunde Hinzufügen")
|
||||
|
||||
onClicked: appLoader.source = "AddCustomer.qml"
|
||||
}
|
||||
}
|
||||
ColumnLayout {
|
||||
id: tableColumn
|
||||
|
||||
clip: true
|
||||
|
||||
anchors {
|
||||
bottom: parent.bottom
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
top: searchBar.bottom
|
||||
}
|
||||
RowLayout {
|
||||
id: sortView
|
||||
|
||||
RadioButton {
|
||||
id: showAll
|
||||
|
||||
checked: true
|
||||
text: qsTr("Alle")
|
||||
|
||||
onClicked: viewCriterion(showAll)
|
||||
}
|
||||
RadioButton {
|
||||
id: showInterested
|
||||
|
||||
text: qsTr("Interessent")
|
||||
|
||||
onClicked: viewCriterion(showInterested)
|
||||
}
|
||||
RadioButton {
|
||||
id: showClientele
|
||||
|
||||
text: qsTr("Kunden")
|
||||
onClicked: viewCriterion(showClientele)
|
||||
}
|
||||
RadioButton {
|
||||
id: showProvider
|
||||
|
||||
text: qsTr("Lieferant")
|
||||
|
||||
onClicked: viewCriterion(showProvider)
|
||||
}
|
||||
RadioButton {
|
||||
id: showFinished
|
||||
|
||||
text: qsTr("Erledigt")
|
||||
|
||||
onClicked: viewCriterion(showFinished)
|
||||
}
|
||||
}
|
||||
HorizontalHeaderView {
|
||||
id: horizontalHeader
|
||||
|
||||
@@ -107,7 +98,6 @@ Item {
|
||||
property real newWidth: 0
|
||||
|
||||
Layout.fillHeight: true
|
||||
//height: tableColumn.height - (sortView.height + horizontalHeader.height)
|
||||
Layout.fillWidth: true
|
||||
alternatingRows: true
|
||||
columnSpacing: 1
|
||||
|
||||
Reference in New Issue
Block a user