Hi,
For a basket-ball club, I have a page with a table, dataset and match collection, and a “season” dropdown allowing to choose the season (2018-2019 …). Some columns allow for sorting (“date”, “équipe” and “adversaire”) with a click on the column header.
Live website :
https://www.collongebasketclub.net/
Everything works fine on windows and Androïd, but not on Ipad nor Iphone (IOS 12.2), with Javascript enabled in Safari of course : the match table loads, but without any filtering. And choosing a season in the dropdown doesn’t filter the table. Moreover, clicking on the table headers does not sort the table (quite expected as the same
function search_dataset1(tri, saison)
function is called for all these tasks). Here is the code involved (without the column header-click events):
export function dropdown1_change(event) { // reloads the table according to season chosen from dropdown
$w('#dataset1').onReady(() => {
search_dataset1('dateHeure', $w('#dropdown1').value) // f call
})
}
export function dataset1_ready() { // refreshes the "season" dropdown according to last table data at end of dataset load
let tableRows = $w('#table1').rows;
var dt0 = tableRows[0]['dateHeure'];
var dt = Date(tableRows[0]['dateHeure'].valueOf());
var Year = dt.substring(11,15);
if (dt0 < new Date(Year,8,1)) {
var Year0 = Year;
--Year;
$w('#dropdown1').value = Year+'-'+Year0;}
else {
var Year1 = Year;
++Year;
$w('#dropdown1').value = Year1+'-'+Year;}
search_dataset1('dateHeure', $w('#dropdown1').value); // f call
}
function search_dataset1(tri, saison){
if (saison === '') {
$w("#dropdown1").selectedIndex = 0;
var dpd = $w('#dropdown1').value;
}
else {
var dpd = saison;
}
var lowerYear = dpd.substring(0,4);
var upperYear = dpd.substring(5,9);
lowerDate = new Date(lowerYear.concat('-','8','-','1'));
upperDate = new Date(upperYear.concat('-','7','-','30'));
if (tri==='dateHeure'|| tri==='') {
wixData.query('match')
.gt('dateHeure', lowerDate)
.lt('dateHeure', upperDate)
.descending(tri)
.limit(300)
.find()
.then( (res) => {
let tableRows = res.items;
$w('#table1').rows = tableRows;
})
}
else {
wixData.query('match')
.gt('dateHeure', lowerDate)
.lt('dateHeure', upperDate)
.ascending(tri)
.limit(300)
.find()
.then( (res) => {
let tableRows = res.items;
$w('#table1').rows = tableRows;
})
}
}
Is there a dropdown compatibility issue with IOS ? or anything else ?
Any idea ?