This commit is contained in:
zhuzichu
2023-09-28 12:31:20 +08:00
parent 0e4d81c7c8
commit 52c806eeff
4 changed files with 96 additions and 12 deletions

View File

@ -14,6 +14,23 @@ FluContentPage{
loadData(1,1000)
}
Component{
id:com_checbox
Item{
FluCheckBox{
anchors.centerIn: parent
checked: true === options.checked
enableAnimation: false
clickListener: function(){
modelData.checkbox = table_view.customItem(com_checbox,{checked:!options.checked})
tableModel.setRow(row,modelData)
}
}
}
}
Component{
id:com_action
Item{
@ -29,6 +46,9 @@ FluContentPage{
FluFilledButton{
text:"编辑"
onClicked: {
var obj = tableModel.getRow(row)
obj.name = "12345"
tableModel.setRow(row,obj)
showSuccess(JSON.stringify(tableModel.getRow(row)))
}
}
@ -60,12 +80,14 @@ FluContentPage{
const dataSource = []
for(var i=0;i<count;i++){
dataSource.push({
checkbox: table_view.customItem(com_checbox,{checked:true}),
checked:true,
name: getRandomName(),
age:getRandomAge(),
address: getRandomAddresses(),
nickname: getRandomNickname(),
longstring:"你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好",
action:com_action
action: table_view.customItem(com_action)
})
}
table_view.dataSource = dataSource
@ -105,6 +127,13 @@ FluContentPage{
}
anchors.topMargin: 20
columnSource:[
{
title: '选取',
dataIndex: 'checkbox',
width:80,
minimumWidth:80,
maximumWidth:80
},
{
title: '姓名',
dataIndex: 'name',
@ -166,7 +195,4 @@ FluContentPage{
table_view.resetPosition()
}
}
}