dojo

Dojo, how to do onclick event on a DIV

冷暖自知 提交于 2019-12-06 02:11:59
问题 There was a fade out sample in the internet.. http://docs.dojocampus.org/dojo/fadeOut?t=tundra but i want to do something different.. i want people directly click on the text then the text will fade out. in my code there is a div wrap the text <div id='parentNode'> <div id='textDiv' onClick='whenClickAnyWhereWithinThisDiv_performFadeOut()'> <div id='iconDiv'/> <div id='messageDiv'/> </div> <div> Code as show below, what i want is, when people click anywhere within the textDiv, then the whole

How do I use uncompressed files in Dojo 1.7?

可紊 提交于 2019-12-06 01:20:17
I've created a Dojo module which depends on dojox/data/JsonRestStore like this: define("my/MyRestStore", ["dojo/_base/declare", "dojox/data/JsonRestStore"], function(declare, JsonRestStore) { var x = new JsonRestStore({ target: '/items', identifier: 'id' }); ... which is fine. But now I want to have the the uncompressed version of the JsonRestStore code loaded so that I can debug it. I can't find any documentation on how to do this, but since there is a file called 'JsonRestStore.js.uncompressed.js' I changed my code to: define("my/MyRestStore", ["dojo/_base/declare", "dojox/data/JsonRestStore

Dojo1.6新特性:AMD规范

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-06 00:57:55
1. AMD的由来 前端技术虽然在不断发展之中,却一直没有质的飞跃。除了已有的各大著名框架,比如Dojo,JQuery,ExtJs等等,很多公司也都有着自己的 前端开发框架。这些框架的使用效率以及开发质量在很大程度上都取决于开发者对其的熟悉程度,以及对JavaScript的熟悉程度,这也是为什么很多公司 的技术带头人都喜欢开发一个自己的框架。开发一个自己会用的框架并不难,但开发一个大家都喜欢的框架却很难。从一个框架迁移到一个新的框架,开发者很有可 能还会按照原有框架的思维去思考和解决问题。这其中的一个重要原因就是JavaScript本身的灵活性:框架没办法绝对的约束你的行为,一件事情总可以 用多种途径去实现,所以我们只能在方法学上去引导正确的实施方法。庆幸的是,在这个层面上的软件方法学研究,一直有人在去不断的尝试和改 进,CommonJS就是其中的一个重要组织。他们提出了许多新的JavaScript架构方案和标准,希望能为前端开发提供银蛋,提供统一的指引。 AMD规范 就 是其中比较著名一个,全称是Asynchronous Module Definition,即异步模块加载机制。从它的规范描述页面看,AMD很短也很简单,但它却完整描述了模块的定义,依赖关系,引用关系以及加载机制。 从它被requireJS,NodeJs,Dojo,JQuery使用也可以看出它具有很大的价值,没错

Dojo学习3 给客户一个提示:dijit.Tooltip

一笑奈何 提交于 2019-12-06 00:57:22
3. 给客户一个提示:dijit.Tooltip 在大多数业务系统中,有很多表单的填写都很复杂,有些文本框的含义比较难理解。为了给使用者一个提示,html默认有一个title属性,比如<div title=’haha’>test</div>,如果设置了这个属性,浏览器会在你鼠标停留在这个元素上的时候,给出你一个提示。 后来微软为了解决<select>控件的一个bug,又提供了window.createPopup()方法,这个方法可以定制一个popup窗口。也可以很好的显示提示信息。 现在dojo为我们提供了一个更美观,更实用,更方便的控件。Dijit.Tooltip控件的外观可以方便的定制,而且使用起来非常方便。 当然它也有它的不足之处,比如,当一个页面有两个控件想共用一个tooltip的话,就会失效。下面给出一个最简单的例子: <html> <head> <title>Dojo Tooltip Widget Test</title> <script type="text/javascript" src="testBidi.js"></script> <script type="text/javascript" src="../js/dojo/dojo.js" djConfig="parseOnLoad: true, isDebug: true"></script> <script

Dojo入门与dojo项目配置方案(一)

↘锁芯ラ 提交于 2019-12-06 00:04:45
何为 dojo Toolkit Dojo Toolkit (以下简称 dojo )是一个 javascript 语言实现的、跨浏览器的 DHTML ( Dynamic HTML )工具包。 Dojo ToolKit 包括了构建大规模 Ajax 驱动的 web 应用程序所需要的一切。所以,你也可以把他看成是一个 Ajax 库,但它不仅仅是个 ajax 库。 dojo 功能远比你想象的要强大,几乎能够满足你开发 web 应用时所需要的。当然, dojo 的学习难度比较大,但是一旦你掌握了它,你会发现使用 dojo 来开发应用原来是这么方便和得心应手。 Dojo 框架的组成 Dojo 大致可以分成 dojo 、 dijit 、 dojox 这三个包( Package )。 dojo 包是 dojo toolkit 的基础,它包含了整个框架最基础的部分,包括 Ajax 基础、事件等。 dijit 包里面包含了基于模板的布局组件( widget )类。如对话框日历、树等。 dojox ( dojo eXtensions )是一个扩展区,提供了更加绚丽的组件和一些新奇的组件,很强大! 下图是 dojo 的文件夹目录: 如果你只需要 dojo 的 ajax 与事件操作,完全可以不使用 dijit 和 dojox 。 Dojo 工具包与 AMD (异步模块加载) Dojo 中的功能是模块化的

Layout implementation for Dojo MVC

╄→尐↘猪︶ㄣ 提交于 2019-12-05 23:27:47
问题 I started a dojo project from scratch by trying using good practice from the very beginning. I'm really new to dojo toolkit, so I'm walking through lots of documentations and samples which leave me with a lots of cool stuff but no way on how to implement an architecture for future dev (or add-ons). I have searched the web and found this dojo boilerplate project which seems to be a good start for putting it all together, but I wanted something more, I wanted to implement the MVC pattern (I

How to make height of a dijit Accordionpane dynamic

坚强是说给别人听的谎言 提交于 2019-12-05 23:21:15
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'}).placeAt("test"); var accordPane = new dijit.layout.ContentPane({"title": "test", "content":"<div style=

Dojo custom build with NLS / localisation

谁说胖子不能爱 提交于 2019-12-05 22:49:36
问题 I have a problem implementing a cross domain custom build in Dojo. The situation is as follows: i have a pretty large application, with a good number of localisation bundles, so basicly the directory structures is like core\ (my module) nls\ fr\ en\ .... When building my module the result is a big core.js/core.xd.js file, which, bien sur, does not contain the localisations. In the localisation nls directories (en/fr/etc) i find after the build each bundle builded/minified, and a bigger file

How to show a checkbox in a dojo datagrid?

只谈情不闲聊 提交于 2019-12-05 21:17:14
How to show a checkbox in a dojo datagrid? Use formatter function as described in Widgets Inside dojo.DataGrid You can return new dijit.form.Checkbox from formatter function in dojo 1.4 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 awesome?", width: "auto", styles: "text-align: center", type: dojox.grid.cells.Bool, editable: true } Please make

Loading Dojo Library from AOL and Widget Codes from Local?

柔情痞子 提交于 2019-12-05 21:05:41
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 exception: Could not load cross-domain resources: myWidget.widgetExample ...". I am not sure if I have