dojo

DOJO : How do you reinitiate form elements after ajax call?

空扰寡人 提交于 2020-01-25 09:16:27
问题 I'm trying to do a couple of things using Zend Framework & Dojo Toolkit, and any help would be appreciated. Here's the problem: I have a form that is rendered with the Zend Framework form class, which has an ajax radio button selection. Clicking one of these radio buttons will send an ajax request to another controller, which has no layout, just a rendered form. The ajax request will then populate a div with the new form options. Problem is, when I replace the innerHTML of the div with the

Dojo version compatibility

只愿长相守 提交于 2020-01-24 21:56:06
问题 I started working on a web application that currently uses version 0.4. How would I go about upgrading to the latest version, 1.5? I don't think it's backward compatible? Would I make a sub-directory in the "js" dir, call it v1.5, and add new code using a new tag that references the new version? Then, over time, refactor the old code to use the new version? 回答1: There are a lot of changes from 0.4 to the current version (1.5). There used to be some porting guides available on the Dojo site,

Avoid decimal values in dijit/form/HorizontalSlider

拈花ヽ惹草 提交于 2020-01-24 20:41:05
问题 In dijit/form/HorizontalSlider on change I am getting values in a textbox. The values are decimal, like 51.66777777 . I want only 51 . <div id="horizontalSlider"></div> <input type="text" id="sliderValue" data-dojo-type="dijit.form.TextBox" style="width:190px;" onkeyup="getSliderTxtBoxValue();"> var slider = new HorizontalSlider({ name: "horizontalSlider", value: 1, minimum: 1, maximum: 500, discreteValues: 10, intermediateChanges: true, style: "width:200px;", onChange: function(value){ dom

Javascript function variable all of a sudden becomes undefined?

烂漫一生 提交于 2020-01-24 10:40:18
问题 this is the weirdest thing. My code is below: function menuSwipe(init){ dojo.query('div.fill div.container div.menu div.group ul').forEach(function(item){ dojo.fx.wipeOut({ node: item, duration: 1 }).play(); dojo.query('li', item).forEach(function(childrenItem){ if (dojo.hasClass(childrenItem, 'active')) childrenItem.parentNode.className = 'items active'; }); if (item.className == 'items active') { dojo.query('div.category', item.parentNode).forEach(function(parentItem){ setTimeout(function()

Is there any javascript library to capture mouse/keyboards events and send them to external server?

社会主义新天地 提交于 2020-01-23 01:18:11
问题 What I need is something which: can catch all keyboard events can catch all mouse events (clicks, movement) can catch page scrolling, possibly taking care about browsers differences send data to external server using JSONP (or anything else, but need to work not only in newest browsers) is quite small, at most xx kB I hope I would like to find something which have at least 3 of above implemented properly. I can also look at js frameworks like Dojo or JQuery if they can help me, but then will

Dojo dialog close event on X (top-right)

左心房为你撑大大i 提交于 2020-01-22 17:45:06
问题 Im using Dojo to create a simple dialog to create a user in a system. The problem is I get the error: Tried to register widget with `id==user_submit` but that `id` is already registered user_submit , is a Dojo button I have to finish the form inside the dialog. When I close the dialog by clicking it and submitting the form there is no problem in opening the dialog again (in the click event on the button I have this line of code: dijit.byId("user_submit").destroy(); but if I close the dialog

How to solve Android Phonegap app SyntaxError: Parse error? (Blank Screen issue)

帅比萌擦擦* 提交于 2020-01-21 19:43:46
问题 I'm using weinre to be able to make remote debug on an app being executed on an android emulator, running on Mac OS X (latest version). Context (eventually necessary) : The current AVD (Android Virtual Device) that I'm using is: Device : Nexus 4 (4.7", 768 x 1280: xhdpi) Target : Android 2.3.3 - API Level 10 Javascript Framework : Dojo, v1.9 Actual Problem : I'm trying to initialize a method from the remote console (the weinre ), but once I started calling it I get the respective output: 1st

How to solve Android Phonegap app SyntaxError: Parse error? (Blank Screen issue)

落花浮王杯 提交于 2020-01-21 19:40:13
问题 I'm using weinre to be able to make remote debug on an app being executed on an android emulator, running on Mac OS X (latest version). Context (eventually necessary) : The current AVD (Android Virtual Device) that I'm using is: Device : Nexus 4 (4.7", 768 x 1280: xhdpi) Target : Android 2.3.3 - API Level 10 Javascript Framework : Dojo, v1.9 Actual Problem : I'm trying to initialize a method from the remote console (the weinre ), but once I started calling it I get the respective output: 1st

arcgis for javascript之ArcGISDynamicMapServiceLayer图层控制的实现

白昼怎懂夜的黑 提交于 2020-01-20 20:01:39
图层控制是非常多GIS系统里面必须的一个小功能,本文就说说arcgis for javascript下ArcGISDynamicMapServiceLayer图层控制的实现方式。首先看图: 实现效果 重点有下面两点:1、获取ArcGISDynamicMapServiceLayer的图层;2、控制图层的显示。 图层的获取可通过layerInfos实现,图层的显示通过setVisibleLayers实现,源码例如以下: <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"/> <title>Simple Map</title> <link rel="stylesheet" href="http://localhost/arcgis_js_api/library/3.9/3.9/js/esri/css/esri.css"> <style type="text/css"> @import "http://localhost/arcgis_js_api/library/3.9/3.9/js

上层建筑——DOM元素的特性与属性(dojo/dom-attr)

十年热恋 提交于 2020-01-20 18:31:25
  上一篇返本求源中,我们从DOM基础的角度出发,总结了特性与属性的关系。本文中,我们来看看dojo框架是如何处理特性与属性的。dojo框架中特性的处理位于dojo/dom-attr模块属性的处理为与dojo/dom-prop模块中。 attr.set()   方法的函数签名为: require(["dojo/dom-attr"], function(domAttr){ result = domAttr.set("myNode", "someAttr", "value"); });   “someAttr”代表特性名称,但有时候也可以是一些特殊的属性名,如:‘textContent’:      可以看到上图中使用attr设置innerText只会在html标签中增加innerText这个自定义特性,而无法改变文本,使用textContent却能够达到改变文本的目的。其中缘由就是因为在attr模块建立了forceProps字典,在此字典中的key全部使用prop模块来设置: forcePropNames = { innerHTML: 1, textContent:1, className: 1, htmlFor: has("ie"), value: 1 }   set()方法中主要处理以下几件事: “someAttr”除了可以是字符串外,还可以是key-value对象