How do I add an external css style element to a div element in a custom widget?
1
I created a custom widget using the App Store Widget Boilerplate and now I have this template: Grid.html <div class="widgetname"> <div id="grid" data-dojo-attach-point="gridNode"></div> </div> And I want this grid to use the css style element ./ilb/dgrid/css/grid.css#.dgrid. I'm not familiar with css, certainly not the jargon, so the only thing I have come up with so far is 'loading the css'? I got the idea from the basic hello world page and I don't know what to do next. Grid.js define([ ... "dojo/text!GridGenerator/widget/template/GridGenerator.html", "dojo/text!GridGenerator/lib/dgrid/css/dgrid.css" ], function (..., widgetTemplate, dgridCss) {
asked
Rogier Sluimers
1 answers
0
In recent versions of Mendix you don't need to include a css file this way. You can simply create a css file called MyCustomWidget.css (replace MyCustomWidget with your widget name) and put in the the widget folder structure. Place that in the folder 'ui' in your MyCustomWidget.js file directory.
Mendix will consolidate all *.css files in a file 'widgets.css'
It helps to extract a recently updated widget from the appstore and analyse it.