top of page

Forum Posts

Jeff Haskins
May 07, 2019
In Coding with Velo
Corvid does not provide permissions for lightboxes...anyone know if this can be coded. Want only certain members to have access to a lightbox.
0
1
200
Jeff Haskins
Mar 26, 2019
In Coding with Velo
The Wix paid plans are just not workable as the management page unuseable for anything beyond a couple pages with permissions and no way to import contacts into a feasible use (I have several thousand to import but no way to give permissions other than manually set each one. Thoughts on code that would provide a workaround?
0
0
17
Jeff Haskins
Mar 15, 2019
In Coding with Velo
Wix page permissions are pretty horrendous in trying to use as an admin. and not seeing how you can set permissions for those users you import or even do so via roles as no way to differentiate the id of those import from regular users, etc. So to do hundreds (I have about 4 thousand to import). Any code replacement available? If they would just fix how it is laid out (you have to slide back and forth and up and down and all around to set permissions if you have more than just 5 or 6 permission pages.
0
0
92
Jeff Haskins
Feb 21, 2019
In Coding with Velo
1) If they change emails and forget password....how do they get a new password? 2) And if new email/password assigned, then what happens to user generated information as it based on owner ID database fields?
0
28
103
Jeff Haskins
Feb 20, 2019
In Coding with Velo
Yes, I get it...but it creates issues. I'll repost the code below that is often used. However, the use of All Categories creates an issue when you have a dataset filter applied. When a repeater is first visited, all is set correctly per the filter. However, once you start using search and then "return" to All Categories, it actually takes you out of the dataset filter and you are then showing the whole dataset. Remedy? import wixData from "wix-data"; import { local } from 'wix-storage'; let lastFilterCombination let lastFilterbusinessCategory; $w.onReady(() => { loadCatalogue(); }); let debounceTimer export function iTitle_keyPress(event, $w) { if (debounceTimer) { clearTimeout(debounceTimer); debounceTimer = undefined; } debounceTimer = setTimeout(() => { filter($w('#iTitle').value, lastFilterbusinessCategory); }, 500); } export function iCategory_change(event) { filter(lastFilterCombination, $w('#iCategory').value); } function filter(combination, businessCategory) { if (lastFilterCombination !== combination || lastFilterbusinessCategory !== businessCategory) { let newFilter = wixData.filter(); if (combination) newFilter = newFilter.contains('combination', combination); if (businessCategory) newFilter = newFilter.contains('businessCategory', businessCategory); $w('#dataset5').setFilter(newFilter); lastFilterCombination = combination; lastFilterbusinessCategory = businessCategory; } } function loadCatalogue() { wixData.query('Catalogue') .find() .then(res => { let options = [{ "value": '', "label": 'ALL CATEGORIES' }]; options.push(...res.items.map(category => { return { "value": category.title, "label": category.title }; })); $w('#iCategory').options = options; }); } export function iTitle_change(event) { //Add your code for this event here: }
0
1
20
Jeff Haskins
Feb 18, 2019
In Coding with Velo
Have tried all the hint codes out there and beaten them around to my own tune, with no luck
0
1
23
Jeff Haskins
Feb 17, 2019
In Coding with Velo
I am verifying member user input to allow insert. This works for === 0 I would like for it to work for === 1, but it does not work by just making that change, so not sure why not. import wixUsers from 'wix-users'; import wixData from 'wix-data'; import wixLocation from 'wix-location'; $w.onReady( () => { if(wixUsers.currentUser.loggedIn) { $w("#button7").label = "Logout"; $w("#button9").show(); } else { $w("#button7").label = "Login"; $w("#button9").hide(); } } ); export function button7_onclick() { // user is logged in if(wixUsers.currentUser.loggedIn) { // log the user out wixUsers.logout() .then( () => { // update buttons accordingly $w("#button7").label = "Login"; $w("#button9").hide(); } ); } // user is logged out else { let userId; let userEmail; // prompt the user to log in wixUsers.promptLogin( {"mode": "login"} ) .then( (user) => { userId = user.id; return user.getEmail(); } ) .then( (email) => { // check if there is an item for the user in the collection userEmail = email; return wixData.query("Profile") .eq("_id", userId) .find(); } ) .then( (results) => { // if an item for the user is not found if (results.items.length === 1) { // this is the line that works with 0, but not 1 // create an item const toInsert = { "_id": userId, "email": userEmail }; // add the item to the collection wixData.insert("Profile", toInsert) .catch( (err) => { console.log(err); } ); } // update buttons accordingly $w("#button7").label = "Logout"; $w("#button9").show(); } ) .catch( (err) => { console.log(err); } ); } }
0
2
139
Jeff Haskins
Feb 17, 2019
In Coding with Velo
Pretty sure a tried and true code. Had been working, but now not working. It is intermittent on pulling info into user input...half the time have to refresh page to get it to pull up, but then it is not actually putting info into the field on submit (was previously working fine). import wixUsers from 'wix-users'; // ... let user = wixUsers.currentUser; let userId = user.id; let isLoggedIn = user.loggedIn; let userRole = user.role; user.getEmail() .then( (email) => { let userEmail = email; // "user@something.com" $w("#input23").value = userEmail; } );
0
6
480
Jeff Haskins
Feb 17, 2019
In Coding with Velo
I have a profile database, and want to query that database to make sure that member has compeleted a profile in that database, it then allows them to click button, but the purpose is to allow them to enter another profile (they will have one person/one business. So the button would scan first to see that results are greater than 0 as shown, but then less than 2 (so they are limited to the one personal/one business. Am I on right track with below...something not quite right. let currentUser = wixUsers.currentUser; { function checkDB() { wixData.query("Profile") .eq("user", currentUser) .find() .then((results) => { if (results.items.length > 0) { $w('#button148').show(); } else { if (results.items.length > 2) { $w('#button148').hide(); } else { $w('#button148').hide(); } } .catch((err) => { let errorMsg = err; } ); }
0
0
105
Jeff Haskins
Feb 15, 2019
In Coding with Velo
So rather than having an onlick button to do search off dropdowns, how does one initiate an onchange style search using public.js file? I hate click to search and prefer an onchange, however as a newbie I am trying to use the input search box and two dropdowns. But I want the dropdowns to be dependent. I've flushed out the typical menu styles using database queries and got a grasp on them, but now on to this project. Will start with the "easy" part of just finding way to make the dropdowns alone. So set up a public.js file for each and got that in place, but question is then how to get an onchange in place for the two to function in filtering a repeater. Help in filling in my blanks??? export function iCategory_change(event, $w) { // insert blank stare export function iSection_change(event, $w) { // insert blink blink
0
0
41
Jeff Haskins
Feb 15, 2019
In Coding with Velo
I also have coded in save search so if they leave and come back the prior search is saved, but with multiple drop downs I could see it nice for a reset for the entire search. There is this for clearing drop downs (you can add line for each drop down (#iwhatever) export function button147_click(event, $w) { //Add your code for this event here: $w("#iCategory").selectedIndex = 0; // add code for other dropdown selection menus } However, this will not work to also clear the text input of a search box...so what have we got out there to remedy? Another issue I have found is that if a null is returned on dropdown search, clearing search does clear drop downs but subsequent searches do not work, you have to refresh screen. So any thoughts on fixing null returns on drop downs? One can add this into the export function above: $w("#categorydropdown").selectedIndex = undefined; It does work if one drop down was selected with a null. However, if a visitor for whatever reason clicks several with resultant nulls, we are back to fubar and screen must be refreshed.
0
0
752
Jeff Haskins
Feb 11, 2019
In Coding with Velo
Morning musing and just getting some of the facts in back of my mind as to how pulling meta data along with url works and complexities one gets into in doing so.
1
1
26
Jeff Haskins
Feb 10, 2019
In Coding with Velo
I have queried a database for a form with result of 0 to insure only one use of form for user (their user email is the query item. I then have created another page, with a different form and query the same item to ensure that they can only complete this second form only once. However, this seems to conflict as the second form somehow can not separate that two different inputs can be allowed, no matter how I adjust the number in the results. Here is the code for the array. And below the full code (the second page form is set exactly the same but for a different form on a different page. Any thoughts on correcting? .then( (results) => { // if an item for the user is not found if (results.items === 0) { // even if I change to 1 or more on new form/page it blocks user // create an item const toInsert = { "_id": userId, "email": userEmail }; AND THE FULL CODE: import wixUsers from 'wix-users'; import wixData from 'wix-data'; import wixLocation from 'wix-location'; $w.onReady( () => { if(wixUsers.currentUser.loggedIn) { $w("#button4").label = "Logout"; $w("#button5").show(); } else { $w("#button4").label = "Login"; $w("#button5").hide(); } } ); export function button4_onclick() { // user is logged in if(wixUsers.currentUser.loggedIn) { // log the user out wixUsers.logout() .then( () => { // update buttons accordingly $w("#button4").label = "Login"; $w("#button5").hide(); } ); } // user is logged out else { let userId; let userEmail; // prompt the user to log in wixUsers.promptLogin( {"mode": "login"} ) .then( (user) => { userId = user.id; return user.getEmail(); } ) .then( (email) => { // check if there is an item for the user in the collection userEmail = email; return wixData.query("Profile") .eq("_id", userId) .find(); } ) .then( (results) => { // if an item for the user is not found if (results.items.length === 0) { // create an item const toInsert = { "_id": userId, "email": userEmail }; // add the item to the collection wixData.insert("Profile", toInsert) .catch( (err) => { console.log(err); } ); } // update buttons accordingly $w("#button4").label = "Logout"; $w("#button5").show(); } ) .catch( (err) => { console.log(err); } ); } } export function button5_onclick() { wixLocation.to(`/Profile/Create/${wixUsers.currentUser.id}`); }
0
0
863
Jeff Haskins
Jan 30, 2019
In Coding with Velo
It appears to work, but wanted to make sure I am not running into issues in doing so.
0
0
23
Jeff Haskins
Jan 28, 2019
In Coding with Velo
Not sure why they limit it because all drop downs scroll. Can it be changed via code?
0
4
26
Jeff Haskins
Jan 28, 2019
In Coding with Velo
Can you limit a repeater display to only appear for certain Titles (or however you have dataset to pull as item. Example: I have a table, but I only want it to appear in the repeater for item A that pulls up in repeater search/selection. If Item B is pulled, then the table will not populate. There may be several of item A type that meet qualifications for the table to populate....
0
1
57
Jeff Haskins
Jan 26, 2019
In Coding with Velo
Seems that you could use a "if cell is not empty" or other filter you could then set up the hook to then pull in image from another field or field from a separate database. Anyone have anything along this lines?
0
1
74
Jeff Haskins
Jan 26, 2019
In Coding with Velo
I know this is probably a simple solution, but not wrapping my head around it. Want user to be able to select an image that will go into database field.
0
3
23
Jeff Haskins
Jan 24, 2019
In Coding with Velo
I thought I saw someone with a solution to this at one time, but unable to find. Is there a way to have a repeater set up with search boxes (I have that coded with the "standard" search box/drop down menus....but now want to have it save that search so when visitor clicks on any link to leave that page, ,when they return the previous search is still active so they do not lose their place?
0
2
36
Jeff Haskins
Jan 24, 2019
In Coding with Velo
Not sure if everyone understands what are and how media gallery fields work as have attempted to get information regarding and everyone always points to using standard uploading images (user input). https://support.wix.com/en/article/about-media-gallery-fields The question is in regards to "media gallery" fields, also known as image gallery. If not able to do so by code, Wix surely is heading towards implementing? Anyone having success with any code towards this end?
3
4
1k

Jeff Haskins

More actions
bottom of page