dojo

How to get the “value” of a FilteringSelect <select> in dojo?

家住魔仙堡 提交于 2019-12-05 01:33:13
I am using dijit.form.FilteringSelect to provide a way to select values from a <select>. The problem is, when using dojo, the label is returned instead of the value of the s. For example: <select name="test" dojoType="dijit.form.FilteringSelect"> <option value="1">One</option> <option value="2">Two</option> </select> Dojo is returning the literal "one" if that option is selected, instead of the value for that option, "1". The same is true for "two" and "2". If dojo is removed from this element, the value is returned as expected. The dojo way to do this would be to use dijit.byId('yourDijitId')

Difference between registry.byId and dom.byId in dojo? What is the advantage of using registry.byId?

巧了我就是萌 提交于 2019-12-05 00:58:20
What is the difference between registry.byId and dom.byId in dojo? What is the advantage of using registry.byId ? In the code below I'm using dijit/registry and dojo/dom for both my textbox ( #myTextBox3 ) and my textbox node ( #textNode3 ). Only two of them are providing results. require(["dojo/parser", "dojo/dom", "dijit/registry", "dijit/form/TextBox", "dojo/domReady!"], function(parser, dom, registry) { parser.parse(); // Locate the JS object. var dibiWidget = registry.byId("myTextBox3"); var dobiWidget = dom.byId("myTextBox3"); var dibiDOM = registry.byId("textNode3"); var dobiDOM = dom

Dojo 样式简介

谁说我不能喝 提交于 2019-12-05 00:10:13
翻译自: https://github.com/dojo/framework/blob/master/docs/en/styling/introduction.md 介绍 Dojo 是基于 HTML 的技术,使用 CSS 为框架中的元素和用它开发的应用程序设置样式。 Dojo 鼓励将结构样式封装在各部件中,以便最大限度复用;同时将外观主题设置到应用程序所有部件上。用户为他们的应用程序设置样式和主题时,这种模式提供了固定的套路,即使混合使用 Dojo 的 @dojo/widgets 库 中的部件、由第三方提供的部件或者为特定应用程序开发的内部使用的部件时也是如此。 功能 描述 为单个部件设置样式 CSS Modules 用于定义,在单个部件的作用域内有效的样式,避免潜在的交叉污染和样式冲突。通过类型化的 CSS 模块导入和 IDE 自动完成功能,部件可以精确的引用 CSS 类名。 强大的主题支持 可以轻松开发出支持主题的部件,这样的部件既能使用简化的、中心化的应用程序主题,也能调整或覆盖单个实例的目标样式(如果需要的话)。 CLI 工具 支持分发自定义主题。 响应式的主题变更 与 Dojo 应用程序中的其他响应式状态变更类似,当一个部件或者整个应用程序的主题发生变化时,只有受影响的部件才会重新渲染。 提取 CSS 属性 每个 CSS 模块可通过 CSS 自定义属性和 var()

How to overload operator equality for JavaScript objects

£可爱£侵袭症+ 提交于 2019-12-04 21:33:18
问题 I have created new objects with Dojo.declare. How to overload operator == for objects ? 回答1: You can't overload == , but == has an implicit .toString() call, so whatever .toString() returns will allow you to effectively overload == (kinda): function foo(){} foo.prototype.toString = function(){ return 42; } var x = new foo(); x == 42; // true As for how to do this in Dojo, I don't use Dojo, sorry, but the gist is that you get a reference to whatever object is creates and add thatObject

dynamic script tag loading is not working as expected

冷暖自知 提交于 2019-12-04 20:17:50
We have an application that uses both the google closure and dojo libraries. We have the following in our index page which works as expected: <script type="text/javascript" src="runtime/src/lib/google-closure-rev26/closure/goog/base.js"></script> <script type="text/javascript" src="runtime/src/lib/dojo_release_132_src/dojo/dojo.js"></script> <script type="text/javascript" src="runtime/src/core/loader.js"></script> We would like to use only one script tag in the actual html source. So we tried to do the following: <head> <script type="text/javascript" src="runtime/src-bootstrap.js"></script> <

How to wait till require finished in dojo

試著忘記壹切 提交于 2019-12-04 20:16:48
I'm providing an infrastructure for other developers, and i'm using Dojo for it. In my Init function i'm using the 'require' method (of course) which one of the parameters are the callback function when all the modules have been loaded. The problem is that the client don't want to use callbacks. He wants to call me and line after to use me (to make my Init method synchronized) - and give him the code back after we for sure finished loading our modules. My Code <script src=..../dojo.js></script> function Init() { var loaded = false; require(["...myFiles..."], function() { loaded = true; }); //

majorTicksColor by interval into dojox gauges using dojo toolkit

你。 提交于 2019-12-04 20:02:53
I'm trying to use dojo toolkit and exactly this gauge . In fact, I want a feature to majorTicksColor and minorTicksColor, I want the color depends for the interval, eg : from 0 to 30 green, from 30 to 70 yellow and from 70 red to 100, or maybe it is degraded. Like this image . Is that possible ? Thank you. Regards, Something like this fiddle ? The principal here is to use an aspect to enhance the drawRange method of the dojox/gauges/GlossyCircularGauge widget. // // Use the new "drawGreenYellowRedCurves" as an *after* aspect to the existing "drawRange" function. // require(['dojox/gauges

How do I use Dojo inside of Worklight correctly?

流过昼夜 提交于 2019-12-04 19:36:41
I need some help as well as some advice on how to use Dojo correctly in my project. At the moment, this is what I'm doing: Say I setup a project named 'Test'. Test.html is the first file hit, and in that file I have the following: <script type="text/javascript" data-dojo-config="isDebug: false, async: true, parseOnLoad: true" src="dojo/dojo.js"></script> <script type="text/javascript" src="dojo/core-web-layer.js"></script> <script type="text/javascript" src="dojo/mobile-ui-layer.js"></script> <script type="text/javascript" src="dojo/mobile-compat-layer.js"></script> <script type="text

Whats the best way to programatically open a pane inside Dijit AccordionContainer

两盒软妹~` 提交于 2019-12-04 19:21:01
I am trying open & close accordion panes programatically. Here is the simplified version of my code. Even though I set the first pane's selected to false and and second pane's selected to true, only the first pane opens when it loads on the browser (FF3). var accordionContainer = new dijit.layout.AccordionContainer().placeAt("test"); var accordPane = new dijit.layout.ContentPane({"title": "test", "content":"hello"}); var accordPane2 = new dijit.layout.ContentPane({"title": "test1", "content":"hello1"}); accordionContainer.addChild(accordPane); accordionContainer.addChild(accordPane2, 1);

Dojox charting programmatically using store series

旧时模样 提交于 2019-12-04 19:19:25
I have been trying to get dojo charting working using the programmatic method. I have tried the following but the graph is not showing. //Requirements dojo.require("dojo.data.ItemFileWriteStore"); dojo.require('dojox.charting.Chart2D'); dojo.require('dojox.charting.widget.Chart2D'); dojo.require('dojox.charting.themes.PlotKit.blue'); dojo.require('dojox.charting.plot2d.Columns'); dojo.require('dojox.charting.StoreSeries'); dojo.ready(function() { var data = {"identifier":"MyMonth","label":"MyMonth","items":[{"MyAmount":"98498.67","MyMonth":"1"},{"MyAmount":"114384.10","MyMonth":"2"},{"MyAmount