Fix highlighting bug on registration
This commit is contained in:
parent
2213765a39
commit
14bbd77e71
2 changed files with 19 additions and 9 deletions
|
@ -42,6 +42,7 @@ DataListView {
|
|||
}
|
||||
|
||||
property var widgetData: currentWidgetData
|
||||
property var athletes
|
||||
|
||||
function getSubtitle() {
|
||||
var titleString
|
||||
|
@ -90,7 +91,7 @@ DataListView {
|
|||
return widgetData[ "athletes" ][index]["firstname"] + " " + widgetData[ "athletes" ][index]["lastname"] + " (" + fedName + ")"
|
||||
}
|
||||
|
||||
function changeCat(){
|
||||
function changeCat() {
|
||||
var cats = control.widgetData["categorys"]
|
||||
|
||||
cats.sort(function(a, b) {
|
||||
|
@ -110,6 +111,14 @@ DataListView {
|
|||
selector.appear(selectOptions, qsTr("select cat"))
|
||||
}
|
||||
|
||||
function filterAthletes(athletes) {
|
||||
var filtered = athletes.filter(function(athlete){
|
||||
return parseInt(athlete.cat) === parseInt(params.cat)
|
||||
})
|
||||
|
||||
return filtered
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: selector
|
||||
function onSelectionFinished(index, data) {
|
||||
|
@ -119,12 +128,9 @@ DataListView {
|
|||
}
|
||||
}
|
||||
|
||||
status: model === 0 ? 901:200
|
||||
|
||||
model: widgetData[ 'athletes' ] === undefined ? 0:widgetData[ 'athletes' ].length
|
||||
|
||||
Component.onCompleted: {
|
||||
if(model > 0){
|
||||
athletes = filterAthletes(widgetData["athletes"])
|
||||
if(athletes.length > 0){
|
||||
control.ready = true
|
||||
control.status = 200
|
||||
}
|
||||
|
@ -136,16 +142,19 @@ DataListView {
|
|||
|
||||
onRefresh: {
|
||||
updateData({}, false)
|
||||
athletes = []
|
||||
athletes = filterAthletes(widgetData["athletes"])
|
||||
}
|
||||
|
||||
model: athletes
|
||||
|
||||
delegate: ItemDelegate {
|
||||
id: partDel
|
||||
|
||||
property int thisIndex: index
|
||||
property var thisData: widgetData[ "athletes" ][index]
|
||||
property var thisData: modelData
|
||||
|
||||
width: parent.width
|
||||
height: parseInt(thisData.cat) === parseInt(params.cat) ? 50:0
|
||||
width: parseInt(thisData.cat) === parseInt(params.cat) ? control.width:control.width * 0.2
|
||||
|
||||
opacity: 0
|
||||
scale: 0.9
|
||||
|
|
|
@ -134,6 +134,7 @@ Window {
|
|||
//mainStack.push("Pages/AthleteSearchPage.qml")
|
||||
//openWidget({comp: 11651, cat: 26})
|
||||
//openWidget({person: 6623})
|
||||
openWidget({cat: 35, comp: 11181, type: "starters"})
|
||||
}
|
||||
|
||||
FontLoader {
|
||||
|
|
Loading…
Reference in a new issue