dojo

How to load bluebird (pulled from NPM) into a Dojo project as an AMD module?

老子叫甜甜 提交于 2019-12-08 06:49:42
问题 I am working on a Dojo project which uses a number of NPM packages, one of them being bluebird as I need to use Promise in IE. I am looking for the best practice/recommended way to load NPM packages into my project. The following code is an example illustrating my question: require([ 'dojo/dom', 'dojo/request', 'dojo/domReady!' ], function(dom, request) { var message = dom.byId('greeting'); message.innerHTML = "Getting started"; var p1 = new Promise(function(resolve, reject) { setTimeout

Dojo: Get ID of inlineEditBox on OnChange

这一生的挚爱 提交于 2019-12-08 06:41:06
问题 I'm using dojo and dijit and have an inlineEditBox widget. I'm trying to capture the onchange event and send a key/value post to a php page (to set into a database). The value is the new value just submitted, available from e.target.value. That's easy. I'd like the key value to be the id of the inlineEditBox widget. How can I access that programatically? 回答1: Since InlineEditBox is a widget it's best not to monitor DOM level events. Instead, why not connect to InlineEditBox.onChange? For

Dojo/Dijit setting invalid message and failing validation

江枫思渺然 提交于 2019-12-08 05:53:23
问题 I have a form item with missingMessage and invalidMessage defined for the item. I call the form validation method on the item for validation. If the item is empty the missingMessage is called and the red exclamation mark error icon is shown. I am trying to set the invalidMessage on text item when the user enters a specific value how can i get the invalidMessage and the red exclamation mark to show without hard coding a constraint on the text item. I would like to use this for custom

How do I “get” the ID for a “clicked” tab in a dijit.layout.tabcontainer?

非 Y 不嫁゛ 提交于 2019-12-08 05:16:49
问题 I haven't been able to find a clearly defined solution for this. Most are incomplete snippets. Here is a simple sample. See the doSomething() comment: <head> <style type="text/css"> body, html { font-family:helvetica,arial,sans-serif; font-size:90%; } </style> <link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/dojo/1.5/dijit/themes/claro/claro.css"/> <script src="http://ajax.googleapis.com/ajax/libs/dojo/1.5/dojo/dojo.xd.js" djConfig="parseOnLoad: true"> <

Dojo - XHTML validation?

时光毁灭记忆、已成空白 提交于 2019-12-08 05:06:43
问题 Is it possible to make Dojo (javascript) widgets validate for XHTML? If so, how? Can it be something as simple as using CDATA? 回答1: Yes, instead of using the dojoType="dojo.foo.bar" non-standard attribute, you instead need to have a document onload event that "takes over" standard HTML tags in your document and rewrites them into Dojo ones. 回答2: CDATA won't help you here. If you really want to write code according to XHTML DTD/schema, you can do it, but cannot take advantage of the

Disable Dojo validation on certain fields

懵懂的女人 提交于 2019-12-08 04:52:41
问题 I would like to disable client side validation on certain fields in my user form. Currently I have two sets of fields that are displayed depending on the value of a previous drop down list. i.e. if the drop down list is set to value "A" 1 new field appears in the form. If the drop down list is set to value "B" 3 new fields appear in the form (mutually exclusive from the new form field when "A" is selected). Currently my Dojo client side validation fails because the fields that are not shown

JSON child object with dojo/data/ObjectStore

大城市里の小女人 提交于 2019-12-08 04:26:41
问题 Given the following JSON data: [ { "pk": 2, "model": "corkboard.announcement", "fields": { "body": "Test announcement 2 body.", "date": "2012-04-10T00:59:12Z", "title": "Test Announcement 2" } }, { "pk": 1, "model": "corkboard.announcement", "fields": { "body": "Test Announcement 1 body.", "date": "2012-04-10T00:58:56Z", "title": "Test Announcement 1" } } ] I'm creating a dojox/DataGrid but I can't seem to find a way to access "fields" children. Here is the javascript: <script> var

Set default application-wide timeout for xhr requests in Dojo (so that JsonRest calls are affected too)

若如初见. 提交于 2019-12-08 03:55:05
问题 I just discovered that in Dojo there is no way to set an application-wide timeout for xhr calls. In theory I could easily create my own wrapper to xhr and use that. However, I am using JsonRest stores (the aim is to only ever use the stores to interact with data in the application). Amazingly, there is no way to set the timeout for JsonRest calls in Dojo. http://mail.dojotoolkit.org/pipermail/dojo-interest/2012-April/065594.html Is there a way to overload the default xhr calls without having

Dojo not getting loaded into rhino emmbedded in java

笑着哭i 提交于 2019-12-08 03:54:30
问题 I'm trying to render the dojo charts server side. I came across the Rhino and envjs for server side browser emulation. when I tried to an example program to load the dojo.js in the rhino embedded in the java impl, the exception is thrown, Exception in thread "main" javax.script.ScriptException: sun.org.mozilla.javascript.EcmaError: ReferenceError: "location" is not defined. (#15) in at line number 15. My code is as follows: import javax.script.*; import java.io.*; public class

Customising Dojo DateTextBox - want mm/yy input only

不羁的心 提交于 2019-12-08 03:41:34
问题 I'm having a little difficulty programming the DateTextBox widget to operate with a month and year only input, and to put a mm/yy format in the DateTextBox. Can anyone help me tidy this up? <link href="http://ajax.googleapis.com/ajax/libs/dojo/1.9.3/dojo/resources/dojo.css" rel="stylesheet" /> <link href="http://ajax.googleapis.com/ajax/libs/dojo/1.9.3/dijit/themes/claro/claro.css" rel="stylesheet" /> <script src="//ajax.googleapis.com/ajax/libs/dojo/1.9.3/dojo/dojo.js" djConfig="parseOnLoad