dojo

What is the Dojo equivalent to jQuery .live()?

心不动则不痛 提交于 2019-11-28 10:56:31
What is the Dojo equivalent to jQuery .live()? http://api.jquery.com/live/ The only solution I found was to dojo.disconnect the event handlers and re-connect them once a dynamic piece of markup was added to the page. usage and demo dojo.query("body").delegate(selector, eventName, fn); code - rewrites the original mixin-like delegate function of dojo dojo.provide("dojox.NodeList.delegate"); dojo.require("dojo.NodeList-traverse"); dojo.extend(dojo.NodeList, { delegate: function ( selector,eventName, fn) { return this.connect(eventName, function (evt) { var closest = dojo.query(evt.target)

Unable to solve error “ Uncaught SyntaxError: Unexpected token o ”

只谈情不闲聊 提交于 2019-11-28 10:07:21
问题 I am currently practicing using Javascript/Dojo. However, I have an error that I am unable to solve: Uncaught SyntaxError: Unexpected token o I have made a quick snippet of my problem: var data = { "list": { "1": { "Relevance": "Low", "id": 1, "Name": "Inorganic" }, "2": { "Relevance": "Low", "id": 2, "Name": "Mobile" } } } var jsonData = JSON.parse(data); alert(jsonData.list[1].Name); It specifically targets the line with: var jsonData = JSON.parse(data); I would like to know why this is an

How to make a JSON array unique [duplicate]

不打扰是莪最后的温柔 提交于 2019-11-28 09:35:58
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: Array unique values Get unique results from JSON array using jQuery Im having a JSON string like this [ Object { id="38",product="foo"}, Object { id="38",product="foo"}, Object { id="38",product="foo"}, Object { id="39",product="bar"}, Object { id="40",product="hello"}, Object { id="40",product="hello"} ] There are duplicate values in this JSON array..how can i make this JSON array unique like this [ Object { id

Dojo 中间件简介

断了今生、忘了曾经 提交于 2019-11-28 07:26:02
翻译自: https://github.com/dojo/framework/blob/master/docs/en/middleware/introduction.md Dojo 的 中间件 系统能以响应式的方式管理异步或命令式 API,以及影响基于函数的组合部件或其他中间件的行为与属性 API。 框架已提供了几个核心中间件和可选中间件,应用程序开发人员也可以轻松编写自己的中间件。 功能 描述 响应式 DOM 访问 借助中间件,基于函数的部件可以处理和使用输出节点对应的 DOM 部分的具体信息和 API。 控制部件渲染的生命周期 对任何组合部件,中间件可以控制 Dojo 渲染管道的各个部分,如当需要更新渲染时让部件失效。也可以暂停和继续部件的渲染,在等待关键信息可以使用时,短路渲染结果。 框架提供了一些中间件 Dojo 提供了一些中间件,能让部件实现很多功能,如响应和控制焦点、简单的缓存值、响应元素的交叉事件和大小变化事件、CSS 主题、国际化和构建时渲染等。 易于组合和复用 中间件的设计是与基于函数的部件紧密结合的,中间件能组合到部件的层次结构中,并且在开发自定义中间件时也可复用中间件 基本用法 创建中间件 定义基于函数部件的 create() 也可以用于定义中间件 定义一个属性接口(可选),以扩充使用了此中间件的部件的属性接口。当创建组合部件实例时传入这些属性值

Why is my intern test failing with “document is not defined”

落花浮王杯 提交于 2019-11-28 06:27:52
问题 I am new to Intern and struggling with trying to get a simple test to run in my environment. I was able to get the tutorial test to run but I've tried to set up a test where the test file is located inside my app directory hierarchy. The module being tested is located here: sandbox/web/libs/ev/grids/FilterGrid.js The test file is located here: sandbox/web/libs/ev/tests/FilterGrid.js My intern config file is located here: sandbox/tests/intern.js My loader and suites objects looks like this:

IBM Worklight 6.0 - How to include Dojo patch with pre-built Dojo layers?

只谈情不闲聊 提交于 2019-11-28 06:24:08
问题 Developing Worklight 6.0 applications with Dojo 1.9, we're encountering some page navigation problems on Galaxy SII, SIII, Note devices with running Android v4.1.2 (very common). We see these issues were resolved by Dojo patch #17164. This patch is not included in Worklight's default Dojo build. We tried to include it by placing the files in the project's dojox\mobile folder but with no effect - we guess it is being overwritten by unpatched classes during build. Is there any other way to

Dojo DataGrid Context Menu onRowContextMenu displays even when right-clicking in BLANK area of DataGrid

旧街凉风 提交于 2019-11-28 06:02:28
问题 I have a DataGrid that has items in it. When you right-click on one of the rows, a Dojo Context Menu is displayed with the option to delete that row. If you try to right-click on a blank area of the DataGrid, the context menu is NOT displayed.... BUT, if you first right click on a row, and then click the Cancel menu option (which does nothing) or if you left-click somewhere else on the page (which hides the Context Menu) and the go to right click on a blank area of the DataGrid, the Context

Dojo Dialog with confirmation button

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-28 05:05:58
I would like to add a generic dialog with "Ok" and "Cancel" buttons support callback functions. How can I achieve this with a Dojo AMD? For example: myDialog = new Dialog ({ title: "My Dialog", content: "Are you sure, you want to delete the selected Record?", style: "width: 300px", onExecute:function(){ //Callback function console.log("Record Deleted") }, onCancel:function(){ console.log("Event Cancelled") } }); // create a button to clear the cart new Button({ label:"Ok" onClick: myDialog.onExecute() } new Button({ label:"Cancel" onClick: function(){ myDialog.onCancel() } } Here is the

REST vs. RPC in PHP [closed]

别来无恙 提交于 2019-11-28 03:06:27
I'm building my own Ajax website, and I'm contemplating between REST and RPC. If my server supported Servlets I'd just install persevere and end the problem, but my server doesn't support Servlets. RPC is simpler to code (IMO) and can be written in PHP easily. All I need is a database query executer. I'm using the Dojo Toolkit and JSON. Why should I choose REST over RPC or RPC over REST? back2dos Uhm ... to put it simple, both are very abstract models ... so abstract, they naturally occur everywhere... REST is the idea of having resources addressed with a global identifier (the URI in the case

How to prevent Meteor from watching files?

蹲街弑〆低调 提交于 2019-11-28 02:40:33
问题 I would like to use Dojo Toolkit with Meteor. I first copy the whole Dojo Toolkit tree in /public Then, I include it on the client side with: <script src="/dojo/dojo.js" data-dojo-config="async: true"></script>` Everything works fine, except Meteor is actually monitoring every single file in /public for changes, so that it can restart the server. This is actually causing a very long delay during the first request on localhost:3000 . Is there a way of preventing Meteor from watching files from