在 Table 的第 4 列添加一个保留按钮。链接到 Lightbox/pop-up
Add a reserve button to column 4 of a Table. Linked to a Lightbox/pop-up
我正在 Wix 中建立一个新站点。该页面使用 API 来填充一个简单的 4 列 table。规模、气候、价格和储备。我是。试图找出如何将按钮编码到链接到灯箱 "reservation" 的第 4 列(所有行)中。预订按钮不会链接到 API,只是一个供客户填写的表格。
这是我目前拥有的。如何将按钮添加到最后一列?
import {getLocationInfo} from 'backend/WssApiService';
import {getLocationReviews} from 'backend/WssApiService';
import {getAvailableLocations} from 'backend/WssApiService';
$w.onReady(function () {
getLocationInfo('xxxxx').then(function(locationInfo) {
//console.log(locationInfo);
$w("#table1").rows = [];
let rows = $w("#table1").rows;
locationInfo.Location.Units.sort((a, b) => (a.Monthly > b.Monthly) ? 1 : -1);
for (var i = 0; i < locationInfo.Location.Units.length; i++) {
var climateControlled = locationInfo.Location.Units[i].SizeDescriptionsField.filter(function(item) {
return item.includes("Climate") && !item.includes("No Climate");
});
//console.log(climateControlled);
if(climateControlled.length > 0)
{
rows.push({Size: locationInfo.Location.Units[i].UnitSize, climate_control : "Yes", Price: '$' + locationInfo.Location.Units[i].Monthly});
}
else
{
rows.push({Size: locationInfo.Location.Units[i].UnitSize, climate_control : "No", Price: '$' + locationInfo.Location.Units[i].Monthly});
}
}
$w("#table1").rows = rows;
您不能在 Wix 中将按钮插入 Table。为此使用 Repeater 或将 onCellSelect 事件处理程序 (https://www.wix.com/corvid/reference/$w.Table.html#onCellSelect) 添加到 table 并使用代码定义位置。
我正在 Wix 中建立一个新站点。该页面使用 API 来填充一个简单的 4 列 table。规模、气候、价格和储备。我是。试图找出如何将按钮编码到链接到灯箱 "reservation" 的第 4 列(所有行)中。预订按钮不会链接到 API,只是一个供客户填写的表格。
这是我目前拥有的。如何将按钮添加到最后一列?
import {getLocationInfo} from 'backend/WssApiService';
import {getLocationReviews} from 'backend/WssApiService';
import {getAvailableLocations} from 'backend/WssApiService';
$w.onReady(function () {
getLocationInfo('xxxxx').then(function(locationInfo) {
//console.log(locationInfo);
$w("#table1").rows = [];
let rows = $w("#table1").rows;
locationInfo.Location.Units.sort((a, b) => (a.Monthly > b.Monthly) ? 1 : -1);
for (var i = 0; i < locationInfo.Location.Units.length; i++) {
var climateControlled = locationInfo.Location.Units[i].SizeDescriptionsField.filter(function(item) {
return item.includes("Climate") && !item.includes("No Climate");
});
//console.log(climateControlled);
if(climateControlled.length > 0)
{
rows.push({Size: locationInfo.Location.Units[i].UnitSize, climate_control : "Yes", Price: '$' + locationInfo.Location.Units[i].Monthly});
}
else
{
rows.push({Size: locationInfo.Location.Units[i].UnitSize, climate_control : "No", Price: '$' + locationInfo.Location.Units[i].Monthly});
}
}
$w("#table1").rows = rows;
您不能在 Wix 中将按钮插入 Table。为此使用 Repeater 或将 onCellSelect 事件处理程序 (https://www.wix.com/corvid/reference/$w.Table.html#onCellSelect) 添加到 table 并使用代码定义位置。