OK, I think I have something here…
First, I’d like to mention that it TOTALLY isn’t clear, for a newbie like me, when people talk about the browser developper tools that it’s supposed to be understood that we should go into the console section to see the errors that it mentions. There’s probably much more to it, but for now, my point aims the console.
Now, using the developper tools’ CONSOLE, I got a LITTLE bit more help than what the editor’s little dots say. But now, the errors have mostly transferred from the editor to the developper console ![]()
One thing I just realized though :
Since I have 4 dropmenus, shouldn’t I have 4 export function lines? 1 for each drop menu? It’s NOT like in the input box that the visitor can enter key words from “any of the fields”, It’s one drop menu per field. Anyway, “IF AT LAST” I can get what’s already coded to work, from there, I’ll just duplicate what’s done for the other drop menus.
Here’s my CORRECTED code :
//Input search
import wixData from ‘wix-data’;
$w(“#Inventaire_Dataset”).setFilter( wixData.filter())
export function searchInput_keyPress(event, $w) {
contains(“veh_year”, $w(“#input1”))
.contains(“brand”, $w(“#input1”))
.contains(“model”, $w(“#input1”))
.contains(“partName”, $w(“#input1”))
.find()
.then(res => {
console.log(“Dataset is now filtered”);
} )
.catch( (err) => {
console.log(err)
$w(‘#table1’).rows = res.items;}
// ===========
//Dropbox search
export function searchDropdown1_change(event, $w) {
$w(“#Inventaire_Dataset”).setFilter( wixData.filter())
contains(“veh_year”, $w(“#dropdown1”))
.contains(“brand”, $w(“#dropdown2”))
.contains(“model”, $w(“#dropdown3”))
.contains(“partName”, $w(“#dropdown4”))
.find()
.then(res => {
$w(‘#table1’).rows = res.items;}
} );
In the editor :
- I have an error message for line 1 saying that ESLint failed to validate… does it matter? It’s just a comment.
- Line 22 : Unexpected token. When I refer to the dev. tools’ console, console, I see :
public/pages/i93j3.js: Unexpected token, expected , (22:0)
Can you clarify to me the details? The way I understand it is that either there’s something unexpected in the line, OR that a comma IS expected.
That’s all for the editor’s error messages, but the dev. tools’ console says quite a lot more
For shortening of this message, I’ll just put the errors (in red, 2 of them), without the “attentions” (in yelow, 20 of them) :
public/pages/i93j3.js: Unexpected token, expected , (22:0)
22 | export function searchDropdown1_change(event, $w) {
| ^
There was an error in your script
TypeError: n is not a function
at n ( scriptRunner.js:14 )
at UserCodeStore.js:22
at Array.map ()
at t.value ( UserCodeStore.js:17 )
at u ( loadHandler.js:136 )
at lodash.min.js:67
at o ( worker.js:93 )
at Array.forEach ()
at n ( worker.js:74 )
at self.onmessage ( worker.js:55 )
Thanks to all who wish to contribute to this “unmixing up” ![]()