updateRow() with a "wix:image" url hangs on loading forever

I have a problem with using updateRow() to change a table row contents, when using an image derived from a “wix:image” url. The table (and page) locks up or shows “loading…” forever.

To replicate, use the unmodified “Table” element from “Lists & Grids” that shows “three houses for sale”.
Name this table as element ‘#myTable’.
Code is as below.

Create four buttons:
#buttonFillWithHttp’ puts 50 entries into the table, using an image from an HTTP url
#buttonFillWithWix’ puts 50 entries into the table, using an image from a “wix:image” url
#buttonChange2toHttp’ changes row 2 to use the image from HTTP url
#buttonChange2toWixImg’ changes row 2 to use the image from “wix:image” url

At $w.onReady() the table gets 4 rows varying between HTTP and “wix:image” urls.
(It doesn’t actually matter if this is done - the problem happens the same way.)

Use the Fill buttons to fill the table with ether HTTP or with “Wix:image” rows. Either works fine.

Click the “Change row 2 to HTTP”, and table row 2 changes text and changes images fine.

BUT - Click the “Change row 2 to use Wix Image”, and table row 2 disappears, and the table either locks up or shows “loading…” forever. All buttons become unresponsive.

My question is - should it be possible to update a row using a “wix:image”? Works fine for HTTP images.

let myHTTPImage1 = "https://static.wixstatic.com/media/74e764_49549388389c4c16971c2a56e6084e08~mv2.jpg";

let myWixImage1 = "wix:image://v1/74e764_f6ae7987c1ca4544a81bcc468cb792c9~mv2.jpg/file.jpg#originWidth=160&originHeight=48";

/*****************************************/
$w.onReady(function () {
  $w("#myTable").dataFetcher = getRows;
});

/*****************************************/
const myTableData = [
  {"photo": myHTTPImage1, "address": "Row 0", "rooms": "begin", "price": "222" },
  {"photo": myWixImage1, "address": "Row 1", "rooms": "begin", "price": "333" },
  {"photo": myWixImage1, "address": "Row 2", "rooms": "begin", "price": "444" }
];

/*****************************************/
function getRows(startRow, endRow) {
 return new Promise( (resolve, reject) => {
 // Fetch the objects from startRow to endRow from `myTableData`:
 const fetchedDataRows = myTableData.slice(startRow, endRow);
 // resolve to DataRequested object
    resolve( {
      pageRows: fetchedDataRows,
      totalRowsCount: myTableData.length
    } );
  } );
}

/*****************************************/
export function buttonFillWithHttp_click(event) {
 let rows = [];

 for (let i = 0; i < 50; i++) {
    rows.push( {"photo": myHTTPImage1, "address": "http", "rooms": i.toString(), "price": "222" } );
  }

  $w("#myTable").rows = rows;
}

/*****************************************/
export function buttonFillWithWix_click(event) {
 let rows = [];

 for (let i = 0; i < 50; i++) {
    rows.push( {"photo": myWixImage1, "address": "wix img", "rooms": i.toString(), "price": "222" } );
  }

  $w("#myTable").rows = rows;
}

/*****************************************/
export function buttonChange2toHttp_click(event) {
 let rowData = {"photo": myHTTPImage1, "address": "Row 2 now HTTP img", "rooms": "Changed to HTTP", "price": "now HTTP" };

    console.log("rowData", rowData);

    $w("#myTable").updateRow(2, rowData);
}

/*****************************************/
export function buttonChange2toWixImg_click(event) {
 let rowData = {"photo": myWixImage1, "address": "Row 2 now WIX img", "rooms": "Changed to WIX", "price": "now WIX" };

    console.log("rowData", rowData);

    $w("#myTable").updateRow(2, rowData);
}

Have you thought about using repeaters for this design instead of a table?
https://support.wix.com/en/article/about-repeaters

You can find an example of a property search here.
https://www.wix.com/corvid/example/mega-search

Thanks for the suggestion. In the original version I already used repeaters and though it looked fantastic the loading time was terribly and unacceptably slow, ten seconds or more to populate. So I switched to tables which are incredibly faster (sub a second), especially with a lot of almost identical products to show.
I have a workaround at the moment, where I do the code shown below on the image name to remove the “wix:image” from the start of the URL and replace it with an HTTP URL, and remove the additional (HTTP irrelevant) info from the end of the wix:image URL, and it works fine:

img.replace("wix:image://v1/", "https://static.wixstatic.com/media/");
let trunc_at = img.indexOf(".jpg/");
 if (trunc_at >= 0) {
   img = img.substring(0, trunc_at + 4);
 }

However maybe there is an inherent problem with the table updateRow() function when using the “wix:image” URLs.

Console log of when the problem happens:

If you are still encountering problems, please post the editor URL of your site. Only authorized Wix personnel can get access to your site in the editor. Please include the name of the page involved.

Many thanks for looking into this, I’ve created a sandbox site to demonstrate the issue.

https://stitchaholics.wixsite.com/sandbox

Go to the page called “TableTest”.

Preview the page, then open a browser Inspection Console to see all error messages.

Happily click these buttons in any order repeatedly, and all is OK, no browser console errors:
“Fill with htp”
“Fill with Wix”
“Row #2 = http”

But click on button “Row #2 = wixImg”, and the table shows “loading” forever, and the browser console shows an “Uncaught TypeError” message.

the link you posted is broken - please send the editor url

Please try: https://www.wix.com/dashboard/51e94eed-1d02-499b-b716-4665c3892c9a/home

The link is no good. Please send the editor link to the site in order for us to assist.