dojo

Dojo 1.7 how to use dojo components outside of require()

时光毁灭记忆、已成空白 提交于 2019-12-07 15:29:21
问题 I have created Dojo widget like below using AMD loader in Dojo 1.7.2 var myCpane; require([ "dijit/layout/ContentPane" ], function(ContentPane) { myCpane = new ContentPane(); }); myCpane.startup(); // It gives 'myCpane' as undefined In the above example, in the last statment, the variable 'myCpane' is coming as 'undefined', if I use the 'myCpane.startup()' inside the 'require()' callback function then, it will work fine. But I want to use that 'myCpane' variable on outside of the 'require'

Declarative or programatic approach in DOJO?

£可爱£侵袭症+ 提交于 2019-12-07 15:28:57
问题 While creating DOJO Components when should we prefer declarative approach and programatic approach? 回答1: Depends entirely on your needs and preferences. If you have designers rather than programmers needing to add Dojo widgets, it may be preferable for them to use the declarative markup. However, if you insist that the HTML markup pass w3c validation, you'll want to use the programmatic approach instead. I prefer the programmatic approach because it allows me to wrap an entire form as a

How to make height of a dijit Accordionpane dynamic

你离开我真会死。 提交于 2019-12-07 14:52:06
问题 I can't figure out how to tell the accordioncontainer to set height of its accordion pane to auto so that the height of the pane is dynamic depending on its content. In the following code I am adding two panes to an accordioncontainer. One has height of 10px and another has 90px but in both cases the height of the accordion pane is calculated to 10px. Looks like its always taking the height of the first one. var accordionContainer = new dijit.layout.AccordionContainer({'id':'accContainer'})

Loading Dojo Library from AOL and Widget Codes from Local?

[亡魂溺海] 提交于 2019-12-07 14:45:57
问题 I just started to learn Dojo. I followed one site Widget example with some different ways to load Dojo libraries. I like to use AOL reference to load dojo.js like this: <script type="text/javascript" src="http://o.aolcdn.com/dojo/1.2.0/dojo/dojo.xd.js"> </script> and saved my widget codes in local web server like this: scripts/ myWidget/ widgetExample.js ... test.html where widgetExample.js contains my widget class codes, and test.html is my testing page. The error message I got is: "uncaught

Poll the Server with Ajax and Dojo

孤街醉人 提交于 2019-12-07 12:04:54
问题 I'm using dojo.xhrPost to sent Ajax Requests The call is wrapped by a function sendRequest() I've now to continuously (every 3sec) send the same ajax Post to the server How can I implement a Server Poll with Dojo? I basically need to call sendRequest() every 3 secs 回答1: I don't believe that Dojo has a method built-in for polling, so here's a generic method that's applicable across frameworks var Poll = function(pollFunction, intervalTime) { var intervalId = null; this.start = function

wirejs and dojo using the dojo build system (2)

你离开我真会死。 提交于 2019-12-07 11:37:23
问题 (This is the same question as wirejs and dojo using the dojo build system, but with more detail about the problem and tried solutions. The duplicate question is created because this was suggested in a comment). When building a dojo application that uses wire, the dojo loader throws an undefinedModule Error for "./lib/context" that we can't get rid of. I added wire to a large, working dojo project using a git submodule. It turned out that also cujojs when and cujojs meld are required. I added

How can I generate CMAC-AES in javascript

ⅰ亾dé卋堺 提交于 2019-12-07 11:32:06
问题 I am attempting to use the Stanford Javascript Crypto Library to generate an CMAC-AES token for an OAuth 2.0 assertion, but I'm far from being an expert with cryptography. Can someone give an example using sjcl or any open-license js library out there? I'm not even sure it's possible using sjcl's existing functions. I tried using an options object like I saw in this question, but I don't understand the modes or other options, and I couldn't find any documentation on this. I figure the salt

Dojo on a CDN vs own install

ぐ巨炮叔叔 提交于 2019-12-07 10:43:43
问题 I use quite a lot of Dojo, but to date I've only used it by including from a CDN such as AOL/Google. Are there advantages to hosting a copy of Dojo rather than using it via a CDN? I don't have much need to alter the code base, but I imagine there are other advantages/disadvantages? 回答1: by hosting your own Dojo env. you are for example able to make a custom build of dojo. So you only need to load one *.js file. That saves traffic used by the xhr requests. -jstr 回答2: Disadvantage to hosting

how to save a filter in Dojo

孤人 提交于 2019-12-07 10:23:32
问题 I have an EnhancedGrid that users regularly use complex filters on. Is there a way to allow users to save or bookmark a filter so they can easily re-apply it in future? I know I can programmatically set a filter, but I can't predict what filters my users will want. Thank you! edit: made some progress myself... using grid.getFilter() to return a JSON representation of the filter, then json.stringify(jsonRepresentation) to convert it into a string. Now I'm considering my options for how to

custom event is not triggered on dojo widget

穿精又带淫゛_ 提交于 2019-12-07 08:17:17
问题 I have dojo Custom widget. I need to emit a event from the custom widget, this the code where I have added the event listener <!DOCTYPE html> <html> <head> <title></title> <script type="text/javascript"> var dojoConfig = { async: true, parseOnLoad: true, isDebug : true, packages:[ { name:"custom", location:"/Test/js" } ] }; </script> <script src="//localhost:8080/dojo1.9.0/dojo/dojo.js"></script> </head> <body> <script> require(["custom/MyWidget","dojo/on","dojo/dom-construct","dojo/_base