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