dojo

What the difference between dojo.byId and dijit.byId?

为君一笑 提交于 2019-12-07 00:24:48
问题 Each time am trying the get the value of an element in my page, I have an error as is undefined: I have tried dijit.byId('myid').innerHTML('loading...'); I get an error but when i do the same using jquery, it works $­('#myid').html('loading ...') And what is the equivalent of this $('#myid').html() in dojo? Thanks for any advise 回答1: dijit.byId returns a dijit object by some id. dojo.byId is the equivalent of $() . To get/set it's HTML, use dojo.byId("my_id").innerHTML dojo.byId("my_id")

Dojo 1.9 build 'multipleDefine' error while loading locale

拜拜、爱过 提交于 2019-12-06 22:52:31
问题 My dojo application breaks after building, during loading the app, throwing 'multipleDefine' and giving this error: Error {src: "dojoLoader", info: Object} Message: multipleDefine info: Object {pid: "dojo", mid: "dojo/nls/dojo_en-us", pack: Object, url: "dojo/nls/dojo_en-us.js", executed: 5…} Here is my profile: var profile = { // `basePath` is relative to the directory containing this profile file; in this case, it is being set to the // src/ directory, which is the same place as the

Error: Tried to register widget with id==grid1but that id is already registered

浪子不回头ぞ 提交于 2019-12-06 21:35:59
问题 I am currently developing my personal website and part of my site I have a biased view pr avoid duplication of code ... and this view I have a dojox.grid.datagrid ... I can call this view twice in the same page (ruban.phtml) the problem is that I click on 1 button that is the appeal of this view (partial view) and then I click the 2nd button that is the appeal of this view I have an error: Error: Tried to register widget with id == grid but that id is already registered and to address this

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

我只是一个虾纸丫 提交于 2019-12-06 19:56:20
问题 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

Dojo学习1 dojo是什么?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-06 18:14:25
1. dojo是什么? dojo是一个开源的javascript 用户界面开发工具包。它能够使我们更容易编写javascript,更快速的制作大型的界面,在一定程度上使我们更容易开发动态的用户界面。dojo的最根本的东西是“Dojo Base”,一个很小的单独的库文件,这个文件包括了Ajax,事件句柄,页面特效,blazing fast CSS queries,语言工具等等。除此之外,还有一些高质量的工具,比如拖动工具,Ajax表单工具,I/O工具,Json-RPC,国际化(i18n),还有回调方法等。 DOJO的核心层面是窗口系统--dijit,他能够迅速是开发和重用用户接口组件。如果你熟悉HTML和CSS,dijit允许你很快的开发出能够重用的客户端组件。dojo使用HTML的扩展属性来声明和配置一个窗口组件。(比如<div dojoType="dijit.Tree" store="JsonItemStore" ....></div>)。在页面上放置一个时间选取组件就像你给<input>添加一个属性一样简单。通过升级标准的HTML,而不是开发一个新的标记语言,DOJO使用户接口开发起来更容易。它非常的进步,有挑战性,并且它能够是你的用户界面看上去很漂亮,很好用,而且运行的迅速。Dojo已经被小心的编写了,从单元测试到数据绑定系统,它的2D画图API使dojo的界面非常统一。

Dojox charting programmatically using store series

冷暖自知 提交于 2019-12-06 16:04:29
问题 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":

Using dijit.InlineEditBox with dijit.form.Select

好久不见. 提交于 2019-12-06 15:53:34
I'm trying to use a dijit.form.Select as the editor for my dijit.InlineEditBox. Two problems / unexpected behavior seem to occur: Inconsistently, the InLineEditBox doesn't have the initial value set as selected Consistently, after selecting a choice, the value that should be hidden is shown instead of the label. The width isn't set to 130px Here's working code: http://jsfiddle.net/mimercha/Vuet8/7/ The jist <span dojoType="dijit.InlineEditBox" editor="dijit.form.Select" editorParams="{ options: [ {label:'None',value:'none'}, {label:'Student',value:'stu'}, {label:'Professor',value:'prof'

Dojo not getting loaded into rhino emmbedded in java

谁都会走 提交于 2019-12-06 15:34:49
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 Java6RhinoRunner { public static void main(String[] args) throws ScriptException { new Java6RhinoRunner().load(args[0]

replace dojo.query with Sizzle?

送分小仙女□ 提交于 2019-12-06 14:16:53
Dojo has got the slowest selectors compared to other JS frameworks . I was wondering if it was possible to use Sizzle within Dojo to make dojo.query use it behind the scenes? I think it is used in jQuery that way, so it should be possible in Dojo too. Couldn't find any info about how to do that. PS The test at the link seems to be being actively developed and changes daily, so make sure you select the latest version on that page. EDIT: it appeared that the numbers in the test were not correct, and the difference between Dojo and others is not really as radical. That makes the task of including

Dojo DnD: how to access newly copied node on onDndDrop event?

旧时模样 提交于 2019-12-06 14:08:47
I am working on code like the following. 01: var c1 = new dojo.dnd.Source('container1', {copyOnly:true}); // container1 is a div 02: var c2 = new dojo.dnd.Source('container2'); // container2 is a div 03: var list = []; 04: for (var i = 0; i < 3; i++) { list.push( dojo.create('div') ); } 05: c1.insertNodes(false, list); 06: 07: function checkDndCopy(nodes, target){ 08: dojo.forEach(nodes, function(node){ alert(node.id); } ); 09: } 10: dojo.subscribe("/dnd/drop", function(){ 11: var mgr = dojo.dnd.manager(); 12: checkDndCopy(mgr.nodes, mgr.target); 13: }); The nodes inserted to the c1 at line 05