This is what I have done so far.
Start here: https://braphox.wixsite.com/website/enterrp
Enter two numbers such that the second number is 6, or 12, or, 13, or 16 more than the first number.
The difference is stored in UserRP in difference key.
Clicking the second button "Click to see Results: takes you here;
https://braphox.wixsite.com/website/parts
Clicking the search button should call the export function: and assign said difference number as item. Then when I query the NumberOfPartslists database I am comparing two numbers.
(
These lines in the code below:
export function search_click_1(event, $w) { wixData.get(“UserRP”,“differrence”) .then( (results) =>{ let item = results; })
)
My assumption is that I don’t have to parseInt since I am comparing numbers, and the table fills on SearchButton Click.
import wixData from ‘wix-data’;
// For full API documentation, including code examples, visit Velo API Reference - Wix.com
$w.onReady( function () {
$w(“#table1”).columns = [
{
“id”: “col1”, // ID of the column for code purposes
// The field key in the collection whose data this column displays
“dataPath”: “title”,
“label”: “Title”, // The column header
“width”: 100, // Column width
“visible”: true , // Column visibility
“type”: “string”, // Data type for the column
// Path for the column if it contains a link
//“linkPath”: “link-field-or-property”
},
{
“id”: “col2”, // ID of the column for code purposes
// The field key in the collection whose data this column displays
“dataPath”: “rpValue”,
“label”: “RPValue”, // The column header
“width”: 100, // Column width
“visible”: true , // Column visibility
“type”: “Number”, // Data type for the column
// Path for the column if it contains a link
//“linkPath”: “link-field-or-property”
},
{
“id”: “col3”,
“dataPath”: “permutations”,
“label”: “Permutations”,
“width”: 100,
“visible”: true ,
“type”: “Number”,
//“linkPath”: “link-field-or-property”
} //,
// more column objects here if necessary
// …
// …
]});
export function search_click_1(event, $w) {
wixData.get(“UserRP”,“differrence”)
.then( (results) =>{
let item = results;
})
. catch ( (err) => {
let errorMsg=err;
});
////<== changed from ; to , to test for change
wixData.query(‘NumberOfPartslists’)
.eq(‘rpValue’, ‘item’) // We use parseInt to turn string to integer
.find()
.then(res => {
$w(‘#table1’).rows = res.items;
});
//Add your code for this event here:
}