Quantcast
Channel: Mendix Forum Questions
Viewing all articles
Browse latest Browse all 82406

Changing the HTML template of a widget breaks it!

$
0
0

Hi all

Am a bit stuck with what I thought would be a simple challenge.

At my company, all our pages that feature a Checkbox use a custom widget, rather than the default input. We do this because it is more agreeable with the stylesheet we use. However, every time we include one we must add a custom class, "checkbox".

With this in mind, I would like to modify the widget so that it applies this class by default, to save devs time while building. I've been trying to include this line of code in the widget's HTML template

class="checkbox"
 

Before:

After:

So, this works fine when the checkbox is included in the app. However, when the checkbox isn't in any pages and I try to run the app I am met with a blank screen and this error from the console

 

If it's relevant - my process for changing it is opening the MPK file in the AppName/widgets folder, changing the code and putting the MPK back in the folder.

I was hoping someone could help answer my questions

  • What can I add to this widget to add this class without causing issues? Do I need to change something in the javascript?
  • Why does a widget cause issues like this when it is not included in any page?

 

Thanks 

Luke


Viewing all articles
Browse latest Browse all 82406

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>