@yisrael-wix Morning Yisrael, and thank you very much for taking an interest. It’s the site that I run for my local village tennis club. One of the affected pages is here: HUTC - Court 1 (wixsite.com) . It’s a members-only page, but either you can sign up or you can probably use the power of Wix to get in. The problem comes when you click on one of the tables, though I’ve coded round it so the site is not broken.
The relevant bit of the cellSelect event “as was” is shown in the original post. Now the code is modified as follows:
/********** before page load **********/
let Wk1colIDs = [];
let Wk2colIDs = [];
let txtWeekDays = "xxxMonTueWedThuFriSatSun"; //used to convert day names to numbers (Sunday is 7, not zero)
/******* in page load *******/
// Store away column IDs in case they turn out to be screwed
for (let i = 1; i < 8; i++) {
Wk1colIDs[i] = $w("#tabWk1").columns[i].id;
Wk2colIDs[i] = $w("#tabWk2").columns[i].id;
}
/******** in event handlers *********/
// Handle click on Week 1 calendar
export function tabWk1_cellSelect(event) {
let recordID = $w('#tabWk1').rows[event.cellRowIndex]._id; // record ID: hour-court (08-01)
console.log(event.cellColumnId);
// Check that a valid day is selected rather than Time
// Check whether we get "Mon" etc. for column name or random strangeness
let txtBkDay = event.cellColumnId.substr(0,3);
let numBkDay;
if (txtWeekDays.search(txtBkDay) == -1 ) { // first check if a weekday was returned
numBkDay = Wk1colIDs.indexOf(event.cellColumnId); // if not, decode colID from values stored at page load
txtBkDay = txtWeekDays.substr(3 * numBkDay,3);
} else {
numBkDay = 1; // any value other than zero will do at this point
}
// .........
The console.log will show you that when you select Monday this week the cellColumnId returned is columnId_720c5dc1-511e-47b7-98d4-e0cdce02880b. If you are able to get into preview, you will see that clicking the same day returns Mon.
As I mentioned in the original post, this behaviour started a week or so ago after the web site had been tested (not sure exactly when). I had made no edits for several days at the time. Previously the ColumnId was Mon both in preview and on the live site.
Mercifully I’m not in a position similar to that of prasanth where a commercial customer is screaming at me. But even so, there is a certain amount of egg on my face here.
It’s not so much the specific problem that troubles me as the blow to my confidence that a site on Wix can be expected to continue to behave as it did when it was developed and tested. I’d like to know what happened! Is the site corrupt, and if so, how to recover it? Did something at the Wix end change, and if so how to know when and what will change to be prepared?
And my question to prasanth, which he has now answered, was not a joke - it was absolutely key: what other gotchas do I need to watch out for? For example, if it was documented that cellColumnId is subject to “spontaneous change” then that’s not exactly cool, but it’s survivable.