dojo

RectangularRangeIndicator format like triangular using dojo

旧街凉风 提交于 2019-12-12 17:18:28
问题 I'm trying to add an indicator to my vertical gauge but the format of the indicator is like a triangle, but I want it a large line. This is JSFIDDLE example. The code : require(['dojo/parser', 'dojox/dgauges/components/default/VerticalLinearGauge','dojox/dgauges/RectangularRangeIndicator', 'dojo/domReady!'], function (parser, VerticalLinearGauge) { parser.parse(); var ri = new dojox.dgauges.RectangularRangeIndicator(); ri.set("start",0 ); ri.set("value", 30); ri.set("startThickness",100); ri

what's the benefit of the dojo 1.7 AMD framework?

自作多情 提交于 2019-12-12 14:53:33
问题 I have been reading about how the dojo 1.7 loader uses an AMD API/framework here and here too, and I came across this quote on one of the slides: "AMD(’s) greatest benefit isn’t being able to load scripts on-demand, as some people may think, the greatest benefit is the increase of the code organization/modularity and also the reduced need for globals/namespacing." But my question is, can't global variables already be avoided by using normal js functions, and maybe dojo.hitch() if you need to

Dojo.Connect Event doesn't get called - why?

别来无恙 提交于 2019-12-12 12:21:10
问题 I am trying to connect an onMouseDown event to an image with dojo.connect like: dojo.connect(dojo.byId("workpic"), "onMouseDown", workpicDown); function workpicDown() { alert("mousedown"); } Similar code a few lines later, where I'm connecting onMouse* events to dojo.body does work completely properly. but when I click on the image, I'm not seeing the alert window, so the event doesn't get called. Why is that? 回答1: "onMouseDown" should be all lower case when used with DOM events as opposed to

Simple Dojo i18n implementation

别来无恙 提交于 2019-12-12 12:12:29
问题 I just recently started learning dojo for personnal use and for experience. So far, I have been doing the tutorials on various dojo stuff (on their website and over the web) and I have been "struggling" with implementing a concrete infrastructure for more complex application (or good practice). I have find one interesting project (https://github.com/csnover/dojo-boilerplate) and article (http://www.sitepen.com/blog/2011/05/04/what-is-the-best-way-to-start-a-dojo-project/). With that, I think

How to show a checkbox in a dojo datagrid?

浪尽此生 提交于 2019-12-12 09:54:17
问题 How to show a checkbox in a dojo datagrid? 回答1: Use formatter function as described in Widgets Inside dojo.DataGrid You can return new dijit.form.Checkbox from formatter function in dojo 1.4 回答2: I would suggest setting cellType to dojox.grid.cells.Bool, instead of the formatter.The formatter gives you much freedom, but also the responsibility of gathering the data from all the checkboxes (for all the rows) afterwards. Something like this as a structure-entry should do the trick: { name: "is

Dojo Drag and drop: how to retrieve order of items?

狂风中的少年 提交于 2019-12-12 09:05:00
问题 I've created a Source object and configured (via the creator) so that it renders a set of data for my users to order as they wish. This is all working fine. However, I cannot figure out how to retrieve the data once the user has re-ordered it. getAllNodes returns the dom nodes; I need the original data objects. 回答1: It is really easy — just use getItem() (described in the official documentation). Something like that will give you all data elements in order: var source = new dojo.dnd.Source(..

Constrain a moveable object in Dojo

徘徊边缘 提交于 2019-12-12 06:25:56
问题 First of all there is a question/answer for this already: Constrain position of Dojo FloatingPane http://jsfiddle.net/phusick/3vTXW/ I used the above to create movable panes and it was working first. Then I created a module with the object and the constrain doesn't work any more, I can move the object out of the window. I placed the following code in a separate module: define(["dojo/_base/declare", "dojo/dnd/move", "dojox/layout/FloatingPane"], function(declare, move, FloatingPane){ return

How do I get my regular expression code working on my dojo cellWidget object?

廉价感情. 提交于 2019-12-12 06:08:59
问题 How do I get my regular expression code working on my dojo cellWidget object? I'm trying to get this regex working in two places, one with an IP address and another just a simple number field for values between 0 and 3000 but no matter what I try it seems to not like anything. Sometimes I can type a single digit number and I don't get my validation message, otherwise I always get the validation message on both of these. I am using a dijit/form/ValidationTextBox for this Here is my code: { id:

Customize a dojo's ComboBox

半腔热情 提交于 2019-12-12 05:52:02
问题 How to add/replace some picture at the ▼ sign of dijit.form.ComboBox or dijit.form.FilteringSelect and the picture can switch when mouse move in and move out. And how to change popup's bg-color of the ComboBox. Like this web site (I need to copy like the original from that site. But this site use a custom widget then I don't know how to get the source.) If anyone know how to customize like that please teach me. Thanks. 回答1: Changing the look and feel of Dojo widgets is done using themes. http

How to get a deferred handler to return a value to the calling function?

别说谁变了你拦得住时间么 提交于 2019-12-12 05:42:36
问题 Look at the below example to understand what I am trying to do: //Caller.js callingFunction : function (...) { var a = new Assistant(); console.log("This object has been returned ", a.showDialog(...)); }, //Assistant.js showDialog : function (...) { deferred.then(lang.hitch(this, this._showDialog)); //I want to return someObject to callingFunction }, _showDialog : function (dialogData) { ... ... return someObject; },} 回答1: Since it's deferred, there is nothing for it to return before that