Unfortunately i’m not getting any output in the console even though when i check the network tab in the browser the server connect call was successful and the api returned data as shown below:
$(document).ready(function($) {
// Your code here
});
Or if this is not a page load thing, execute your js on the success event of the server connect. In other words, I think your js is running before the server connect has.
Thanks Ken for the reply.
So you’re saying the the dmx.parse('server-connect-name') is correct.
I’m still very new to wappler so wasn’t sure if that syntax is correct.
My code is inside document.ready so I’m going to try your second suggestion.
The server connect might not be directly accessible.
Instead of dmx.parse try dmx.app.data.... in console to check if the server connect is even available.
It might be that if you are using SPA, you will have to qualify the server connect with the route’s name to access it.
@mebeingken you were right about the server connect not loaded when the script run because I tried executing it in the browser console and it worked.
I tried calling the function in the on success event of the server connect initially it wasn’t working because i was adding it as a dynamic event.
I just tried adding it as a static event and everything works now.
Thanks a lot.
But now my question is what is the difference between static and dynamic events in wappler? I’m going to create a new post on it as all the two people I asked said they’re not sure.
Static events are used to run any custom js function.
Dynamic events are used to run the app connect components events, which are available in the dynamic data picker.
Thanks @Teodor, that makes sense.
Is this documented anywhere, I will like to read more on it because I’ve just wasted 2hrs because I didn’t know this.
It will also be great if for the sake of us beginners you add tooltips on hover to some of these things as you’ve done with some other elements. It’s really helpful especially for those of us who are trying to learn wappler on the fly by creating a real product.
Thanks
Sorry about that Sean. I actually meant to write static event since this bit me a while back… but clearly I didn’t. My bad.
You actually can use the dynamic event but the syntax changes. I’ve done this when passing arguments to functions that need to be dynamic. If I recall correctly it becomes