top of page
Forum Posts
Yasser Ashraf
Oct 22, 2022
In Coding with Velo
when i click on any member pages some a lot of times it gives me this time out page and some times it opens normally . this problem i had it recently i have no idea why it is happing ! any help will be appreciated 🌹
0
1
13
Yasser Ashraf
Sep 03, 2022
In Velo Pro Discussion
IS THIS PROBLEM IS GOING TO BE SOLVED AT ALL !!!??? After refresh : i have facing this problem just from yesterday i do not know why ???? i always when i am surfing my site suddenly this page appears is this issue from wix its self or is local from me ?!
0
2
45
Yasser Ashraf
Sep 01, 2022
In Coding with Velo
After refresh : i have facing this problem just from yesterday i do not know why ???? i always when i am surfing my site suddenly this page appears is this issue from wix its self or is local from me ?!
0
0
11
Yasser Ashraf
Aug 28, 2022
In Velo Pro Discussion
i have a question if you have the time !
each user in my site can create an item with specific fields
and there is a dynamic page that view these items
but i added a filter to only show the items of the current user
my question is : now i have a 100 items , the filtering process will take maybe a 1.5 second
but if i have a 5000 items , dose the filtering process will take a longer time ?
and if it will take a longer time , is there any method to make the process faster(like using References) ?
0
2
22
Yasser Ashraf
Aug 27, 2022
In Coding with Velo
This is dynamic page , and there is a repeater to display the content of dataset . I mad a filter to the dynamic set so each user can see their own items. Ok now lets chose any item and click on view more . And there we go , every thing running smoothly . The idea is : If mike have an account and took the url of this item in the picture (this item _owner is mike) And send it to another user called carl , carl will be able to see the content of this item . This is the problem I have I want to make a security wall to check if the user is the owner of this item or not , if he is the owner show content and if it is not re direct the user to the homepage. but I want to do it in a professional way with router or hooks can you help me because I tried to read about it but I did not understand any thing and nothing work for me this is my failed try with router :
import { forbidden, next, ok } from 'wix-router';
export function patient_afterRouter(request, response) {
if (response.data._owner === request.user._id) {
return next();
}
return forbidden();
//TODO: write your code here...
} i am struggling with this for many days and read all docs about router and hooks , any help ?
0
4
54
Yasser Ashraf
May 19, 2022
In Coding with Velo
Facts : - i have this search section over here . - it works just fine i can multi search with this section by name and dropdown and date . - this button over her its job to to clear the inputs (input.value = undefined) . problem : i can not search with one input , i have to fill all inputs so that results appear i want that the user can search by name only or dropdown only or date only and if the user want to multi search he can do it also this is my code :
$w('#dataset1').setFilter(wixData.filter().eq("_owner", ii))
$w('#dataset2').setFilter(wixData.filter().eq("_owner", ii))
$w('#button16').onClick(() => {
$w('#image4').show()
setTimeout(() => { $w('#image4').hide() }, 750)
$w('#dataset1').setFilter(wixData.filter().eq("_owner", ii).eq("date", $w('#appdatePicker2').value).eq("doc", $w('#dropdown2').value).contains("patient", $w('#input2').value).or(wixData.filter().eq('phone', $w('#input2').value)))
$w('#dataset2').setFilter(wixData.filter().eq("_owner", ii).eq("date", $w('#appdatePicker2').value).eq("doc", $w('#dropdown2').value).contains("patient", $w('#input2').value).or(wixData.filter().eq('phone', $w('#input2').value)))
})
$w('#button17').onClick(() => {
$w('#image4').show()
setTimeout(() => { $w('#image4').hide() }, 750)
$w('#appdatePicker2').value = undefined
$w('#input2').value = undefined
$w('#dropdown2').value = undefined
$w('#dataset1').setFilter(wixData.filter().eq("_owner", ii))
$w('#dataset2').setFilter(wixData.filter().eq("_owner", ii))
}) any help will be appreciated thanks for reading...
0
6
29
Yasser Ashraf
Mar 12, 2022
In Coding with Velo
$w('#appbutton11').onClick(()=>{
if( $w('#apprepeater3').collapsed ){
$w('#apprepeater1').collapse()
$w('#apprepeater3').expand()
}
if( $w('#apprepeater1').collapsed ){
$w('#apprepeater1').expand()
$w('#apprepeater3').collapse()
} i really would like that a 1 button can do two different actions so i thought about the if statements . is that the right way to do it ? , if so why it does not work where is the error here ?
0
1
32
Yasser Ashraf
Mar 11, 2022
In Coding with Velo
$w('#listRepeater').onItemReady(($w, itemdata, index) => {
$w('#button7').onClick(() => {
let toInsert = {
"patient": itemdata.title,
"date": $w('#datePicker1').value,
"time": $w('#timePicker1').value,
}
console.log("pass 1")
wixData.insert("appointment", toInsert)
.then((results) => {
console.log("pass 2")
let item = results; //see item below
console.log("pass 3")
})
.catch((err) => {
let errorMsg = err;
}).then(()=>{
$w('#datePicker1').collapse() //do not work
$w('#timePicker1').collapse() //do not work
$w('#button6').show() //do not work
$w('#button7').hide() //do not work
})
})
}) it is just a simple insert function but the last part : $w('#datePicker1').collapse() //do not work
$w('#timePicker1').collapse() //do not work
$w('#button6').show() //do not work
$w('#button7').hide() //do not work dose not work where is the error in my code ? --------------------------------------------------------------------------------- another question if there is an element in a repeater and i want to show it just in the selected item or container without showing in all items or containers in the repeater , can i do that ?and how ?
0
2
44
Yasser Ashraf
Mar 04, 2022
In Coding with Velo
i am trying to save some changes for 2days now but always i get this erorr massage can someone please tell me what the happing here because i started to hate wix , this is the second time can not preview can not save can not publish
0
2
15
Yasser Ashraf
Mar 03, 2022
In Coding with Velo
let ii = $w("#dynamicDataset").getCurrentItem()
$w("#dataset1").setFilter(wixData.filter()
.eq("idPatient", ii._id))
.then(() => {
$w('#repeater1').show
}) this is my code for filtering a repeater , the filter is working just fine but there is a small problem: every time the page loads all items in the collection are populated in the repeater for just a few seconds. ----------------------------------------------- i tried to solve the problem by hiding the repeater then show after the filter using then() , but for reason the repeater still hiden IDK why $w("#dataset1").setFilter(wixData.filter()
.eq("idPatient", ii._id))
.then(() => {
$w('#repeater1').show
}) ----------------------------------------------- i tried also this code to solve it : $w('#repeater1').onItemReady(($w,itemdata,index)=>{
$w('#repeater1').show
}) so that i show the repeater when its ready, the repeater appeared but still did not work ---------------------------------------------- and again i tried another solution : $w('#dataset1').onReady(()=>{
$w('#repeater1').show
}) the repeater appeared but still do not work
0
3
33
Yasser Ashraf
Mar 02, 2022
In Coding with Velo
as the title describe i want populate the data that i just inserted into my data base right away after it being inserted i tried a lot but it just not working , i have to refresh the page to be populated this is my failure code :
ction getdata() {
let query = wixData.query('visits')
return query.limit(1000).find().then((resaults) => {
console.log('getdata', resaults)
return resaults.items
});
}
$w.onReady(function () {
let ii = $w("#dynamicDataset").getCurrentItem()
$w("#dataset1").setFilter(wixData.filter()
.eq("idPatient", ii._id));
$w('#button2').onClick(() => {
let toInsert = {
"idPatient": ii._id,
"quadrant": $w('#dropdown1').value,
"toothnumber": $w('#input1').value,
"premeasure": $w('#dropdown2').value,
"detail": $w('#textBox1').value,
"date": currentdate
};
wixData.insert("visits", toInsert)
.then((results) => {
let item = results; //see item below
})
.catch((err) => {
let errorMsg = err;
});
$w('#textBox1').value = ''
getdata().then((items) => {
$w('#repeater1').data = items
})
})
}); any ideas????
0
7
76
Yasser Ashraf
Feb 27, 2022
In Coding with Velo
i am building a site for doctors & each doctor(member of the site) have his own patients(there is a collection called patients ) i want to add a feature in my site and this feature is : that i want to add a calendar in my site one for each doctor(member of the site) and they can add from their patients into their calendar. p.s : only doctors(member of the site) can manipulate the calendar , by other words calendar only appears to the member of the site i was going for wix booking but idk if that the right choice , if there is any way possible to do that even with code i will be forever grateful for the help
1
3
62
Yasser Ashraf
Feb 26, 2022
In Coding with Velo
i am a beginner in in programing so bear with me please this is a repeater , with 4 inputs should carry and view data from collection called visits i did view visits data in a input so that i can change the values of a certain field, and there is a button to trigger the changes. but i am so stupid and have no knowledge but i am trying my best to learn. this is my code i know its a very ugly and stupid code , but really can use some help because it does not work 😭 export function repeater1_itemReady($W, itemData, index) {
$w('#button3').onClick(() => {
console.log('1 pass')
const item = itemData
const h = item._id
console.log(h)
itemData.detail = $w('#textBox1').value
itemData.quadrant = $w('#input4').value
itemData.premeasure = $w('#input3').value
itemData.toothnumber = $w('#input2').value
let toUpdate = {
"_id": h,
"date": "Mr.",
"detail": $w('#textBox1').value,
"quadrant": $w('#input4').value,
"premeasure": $w('#input3').value,
"toothnumber": $w('#input2').value
};
wixData.update("visits", toUpdate)
.then((results) => {
let item = results; //see item below
})
.catch((err) => {
let errorMsg = err;
});
})
0
4
65
Yasser Ashraf
Feb 24, 2022
In Coding with Velo
const d = new Date()
const currentdate = d.toLocaleDateString()
export function button2_click(event) {
let toInsert = {
"title": '',
"detail": $w('#textBox1').value,
"date": currentdate
};
wixData.insert("visits", toInsert)
.then((results) => {
let item = results; //see item below
})
.catch((err) => {
let errorMsg = err;
});
$w('#textBox1').value = ''
} i have a stupid problem i can't fix it all what this code do store the damn local date but when i check how the stored date looks like i finde this i wnat it to be like this : 24 / 2 / 2022 please help i am stressed out for 2 ours
0
12
64
Yasser Ashraf
More actions
bottom of page