TIL - Code snippets - Best practices - How to - Share your Wappler discoveries

Hello everyone!

TIL, Today I Learned, like every single day when you’re working on something actually!

I thought that it would be great to have a place where we can say “Hey, TIL how to do THIS with Wappler, and this is amazing!” so everyone can share their discoveries during their Wappler journey, code snippets and so on, and I’m sure it will help a lot of people, especially newcomers!

So let’s start :tada:

TIL how to show a default image when the specific row has no image saved with this simple code snippets: dmx-bind:src="'/static/path/here/' + serverconnect.data.query.somevalue.default('static_img.png')"
Source: Default Image Source vs Dynamic Image Source

Now your turn, share your great code snippets and discoveries! :smiley:

2 Likes

TIL to make the rows of a bootstrap table have the colour class from the database:

<tr dmx-bind:class="'table-'+statusColour">

So my record has a field called statusColour and that contains either default, primary, secondary, success, warning, danger and this is then appended to the class table- so you end up with something like this on the page:

<tr class="table-success">

2 Likes