This commit is contained in:
zhuzihcu
2023-06-15 14:46:32 +08:00
parent aab4802d7e
commit 8c45c125e6
9 changed files with 201 additions and 52 deletions

View File

@ -94,6 +94,10 @@ FluScrollablePage{
}
}
FluText{
Layout.topMargin: 20
text:"此TableView适用于小数据量带分页的表格大数据量请使用TableView2。"
}
FluTableView{
id:table_view

View File

@ -10,7 +10,7 @@ FluContentPage{
title:"TableView2"
Component.onCompleted: {
loadData(1,10)
loadData(1,2000)
}
function loadData(page,count){
@ -46,6 +46,29 @@ FluContentPage{
table_view.dataSource = dataSource
}
Component{
id:com_combobox
FluComboBox {
anchors.fill: parent
currentIndex: display
editable: true
model: ListModel {
ListElement { text: 100 }
ListElement { text: 300 }
ListElement { text: 500 }
ListElement { text: 1000 }
}
Component.onCompleted: {
currentIndex=[100,300,500,1000].findIndex((element) => element === Number(display))
selectAll()
}
TableView.onCommit: {
display = editText
}
}
}
FluTableView2{
id:table_view
anchors.fill: parent
@ -60,6 +83,7 @@ FluContentPage{
{
title: '年龄',
dataIndex: 'age',
editDelegate:com_combobox,
width:100,
minimumWidth:100
},