Compare commits
No commits in common. "a5b5a5b942f97897f12e45051198669d62fa481c" and "0e4d81c7c8e619ff531ea3399df566bab7144339" have entirely different histories.
a5b5a5b942
...
0e4d81c7c8
|
@ -13,23 +13,6 @@ 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{
|
||||
|
@ -45,9 +28,6 @@ FluContentPage{
|
|||
FluFilledButton{
|
||||
text:"编辑"
|
||||
onClicked: {
|
||||
var obj = tableModel.getRow(row)
|
||||
obj.name = "12345"
|
||||
tableModel.setRow(row,obj)
|
||||
showSuccess(JSON.stringify(tableModel.getRow(row)))
|
||||
}
|
||||
}
|
||||
|
@ -79,14 +59,12 @@ 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: table_view.customItem(com_action)
|
||||
action:com_action
|
||||
})
|
||||
}
|
||||
table_view.dataSource = dataSource
|
||||
|
@ -126,13 +104,6 @@ FluContentPage{
|
|||
}
|
||||
anchors.topMargin: 20
|
||||
columnSource:[
|
||||
{
|
||||
title: '选取',
|
||||
dataIndex: 'checkbox',
|
||||
width:80,
|
||||
minimumWidth:80,
|
||||
maximumWidth:80
|
||||
},
|
||||
{
|
||||
title: '姓名',
|
||||
dataIndex: 'name',
|
||||
|
@ -194,4 +165,7 @@ FluContentPage{
|
|||
table_view.resetPosition()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -14,23 +14,6 @@ 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{
|
||||
|
@ -46,9 +29,6 @@ FluContentPage{
|
|||
FluFilledButton{
|
||||
text:"编辑"
|
||||
onClicked: {
|
||||
var obj = tableModel.getRow(row)
|
||||
obj.name = "12345"
|
||||
tableModel.setRow(row,obj)
|
||||
showSuccess(JSON.stringify(tableModel.getRow(row)))
|
||||
}
|
||||
}
|
||||
|
@ -80,14 +60,12 @@ 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: table_view.customItem(com_action)
|
||||
action:com_action
|
||||
})
|
||||
}
|
||||
table_view.dataSource = dataSource
|
||||
|
@ -127,13 +105,6 @@ FluContentPage{
|
|||
}
|
||||
anchors.topMargin: 20
|
||||
columnSource:[
|
||||
{
|
||||
title: '选取',
|
||||
dataIndex: 'checkbox',
|
||||
width:80,
|
||||
minimumWidth:80,
|
||||
maximumWidth:80
|
||||
},
|
||||
{
|
||||
title: '姓名',
|
||||
dataIndex: 'name',
|
||||
|
@ -195,4 +166,7 @@ FluContentPage{
|
|||
table_view.resetPosition()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -257,7 +257,7 @@ Rectangle {
|
|||
onReleased: {
|
||||
}
|
||||
onDoubleClicked:{
|
||||
if(typeof(display) == "object"){
|
||||
if(display instanceof Component){
|
||||
return
|
||||
}
|
||||
item_loader.sourceComponent = d.obtEditDelegate(column,row,item_table)
|
||||
|
@ -275,18 +275,11 @@ Rectangle {
|
|||
property var tableModel: table_model
|
||||
property var position: item_table.position
|
||||
property int row: position.y
|
||||
property var modelData: table_model.getRow(row)
|
||||
property int column: position.x
|
||||
property var options: {
|
||||
if(typeof(itemData) == "object"){
|
||||
return itemData.options
|
||||
}
|
||||
return {}
|
||||
}
|
||||
anchors.fill: parent
|
||||
sourceComponent: {
|
||||
if(typeof(itemData) == "object"){
|
||||
return itemData.comId
|
||||
if(itemData instanceof Component){
|
||||
return itemData
|
||||
}
|
||||
return com_text
|
||||
}
|
||||
|
@ -537,13 +530,4 @@ Rectangle {
|
|||
scroll_bar_h.position = 0
|
||||
scroll_bar_v.position = 0
|
||||
}
|
||||
function customItem(comId,options={}){
|
||||
var o = {}
|
||||
o.comId = comId
|
||||
o.options = options
|
||||
return o
|
||||
}
|
||||
function updateRow(row,obj){
|
||||
table_model.setRow(row,obj)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -268,7 +268,7 @@ Rectangle {
|
|||
table_view.interactive = true
|
||||
}
|
||||
onDoubleClicked:{
|
||||
if(typeof(display) == "object"){
|
||||
if(display instanceof Component){
|
||||
return
|
||||
}
|
||||
item_loader.sourceComponent = d.obtEditDelegate(column,row)
|
||||
|
@ -290,18 +290,11 @@ Rectangle {
|
|||
property var tableModel: table_model
|
||||
property point position: item_table.position
|
||||
property int row: position.y
|
||||
property var modelData: table_model.getRow(row)
|
||||
property int column: position.x
|
||||
property var options: {
|
||||
if(typeof(itemData) == "object"){
|
||||
return itemData.options
|
||||
}
|
||||
return {}
|
||||
}
|
||||
anchors.fill: parent
|
||||
sourceComponent: {
|
||||
if(typeof(itemData) == "object"){
|
||||
return itemData.comId
|
||||
if(itemData instanceof Component){
|
||||
return itemData
|
||||
}
|
||||
return com_text
|
||||
}
|
||||
|
@ -580,13 +573,4 @@ Rectangle {
|
|||
function resetPosition(){
|
||||
table_view.positionViewAtCell(Qt.point(0, 0),Qt.AlignTop|Qt.AlignLeft)
|
||||
}
|
||||
function customItem(comId,options={}){
|
||||
var o = {}
|
||||
o.comId = comId
|
||||
o.options = options
|
||||
return o
|
||||
}
|
||||
function updateRow(row,obj){
|
||||
table_model.setRow(row,obj)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue