Dijit / layout / ContentPane when resizing?

Now I am using dojo 1.8.3 and now I have a BorderContainer with 2 ContentPane in my page. I would like to listen to a resize event, code like this

dojo.ready(function(){ dojo.connect(dijit.byId("Container"), "resize", function(changeSize, resultSize){ // do my stuff here... }); }); 

However, anyway, let me know if resizing (splitting) will end? Please advice, thanks!

+4
source share
1 answer

First of all, I would recommend using "modern dojo" since you are still using dojo 1.8. dojo / connect is deprecated, and the dojo / aspect method is now used to "track" function calls.

So, you get something like:

 require(["dojo/ready", "dojo/aspect", "dijit/registry"], function(ready, aspect, registry) { ready(function() { aspect.after(registry.byId("Container"), "resize", function() { // do something after resize has been called... }); }); }); 

If you want to access the arguments passed to the resize function, call aspect.after with true as the last argument, for example:

 aspect.after(registry.byId("Container"), "resize", function(changeSize, resultSize) { // do something with changeSize and resultSize after resize has been called... }, true); 
+6
source

Source: https://habr.com/ru/post/1486967/


All Articles