Discuss anything related to web development but no technical support questions


Post by gregc »

I have a lot of code that uses Dojos domready

https://dojotoolkit.org/reference-guide/1.9/dojo/domReady.html

to ensure the html elements are rendered before javascript runs on it.

does bryntum code have something similar to match that functionality? tia!


Post by Animal »

This is just standard event listening.

https://developer.mozilla.org/en-US/docs/Web/API/Document/DOMContentLoaded_event

https://www.bryntum.com/docs/grid/api/Core/helper/EventHelper

EventHelper.on({
    element          : document,
    DOMContentLoaded : myHandler,
    once             : true
});

Post by gregc »

gotcha, thanks!


Post by gregc »

When I do

const runButton = new Button({ 
					    appendTo : 'toolbar', 
					    id    : 'runblah', 
					    icon    : 'fas fa-user-check', 
					    style    : 'width:16em;height:2em;', 
					    text   : 'Owner', click = blah blah 
					    }
					

is it doing that behind the scenes, so I don't have to worry about EventHelper?


Post by mats »

No, but as long as you include your JS scripts at the end of <body> it'll work just fine and no need to listen for global 'ready' events etc.


Post Reply