dojo

dynamic script tag loading is not working as expected

人走茶凉 提交于 2019-12-09 23:25:51
问题 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

how to upload file using dojo

别说谁变了你拦得住时间么 提交于 2019-12-09 13:56:17
问题 How do I browse to upload a file using Dojo? See the code below: dojox.io.xhrMultiPart({ url: "http://localhost:8080/myWebService", handleAs: "xml", form: dojo.byId("myForm"), load: function(data){ processRequest(data);}, error: function(error){ processError(error); }, backButton: function() { }, mimetype: "text/xml" }); Now which code do I have to append to the above code to upload a file? 回答1: I use dojox.form.Uploader , which will enable you the "Browse" functionality. <input name="file"

How to define Module and use it in dojo with AMD?

拜拜、爱过 提交于 2019-12-09 13:29:44
问题 I am maintaining and extending an old project which was pre-AMD. I wish to add an Chart to the application. for this, I have created a js file as follows: define(["dojox/charting/Chart",...."dijit/Dialog","dojo/dom-construct"], function (Chart) { function showDailyChart(data){ //code to show the chart in a dialog } return customModules.singleChart; }); I have saved this file as /customModules/singleChart.js In My main HTML Page, I have added it to the packages as follows: var dojoConfig = {

Preventing form submission with Dojo

◇◆丶佛笑我妖孽 提交于 2019-12-09 13:13:13
问题 I have a Dojo SubmitButton with jsId="saveParamButtonWidget". I overrided its onClick method by putting: saveParamButtonWidget.onClick = editParam I defined the editParam() function like this: function editParam(eventObj) { dojo.stopEvent(eventObj); // ... } dojo.stopEvent() is supposed to stop event bubbling and default processing. However, the browser will submit the form anyway. I also tried with the following: function editParam(eventObj) { eventObj.stopPropagation(); eventObj

Dynamically add and remove the div on scroll?

馋奶兔 提交于 2019-12-09 12:21:16
问题 I tried to add and remove div tags while scrolling like the Dojo grid works. I only want to display 7 div tags. While scrolling left inside the container, when the first div tag (on the left side) was hidden from the webpage, then that hidden div is removed from the container and a new one is attached onto the right side. The same process should be applied while scrolling to the right. It's similar to this example. But in stead of scrolling the <tr> tag, I want to scroll through <div> 's.

How do I retrieve values from dojo.data.ItemFileReadStore

早过忘川 提交于 2019-12-09 12:12:59
问题 First, I read this short help thread here: CLICK It uses a JSON file built together with PHP which looks something like THIS: { name:'Italy', type:'country' }, { name:'North America', type:'continent', children:[{_reference:'Mexico'}, {_reference:'Canada'}, {_reference:'United States of America'}] }, { name:'Mexico', type:'country', population:'108 million', area:'1,972,550 sq km', children:[{_reference:'Mexico City'}, {_reference:'Guadalajara'}] }, { name:'Mexico City', type:'city',

dijit.form.filteringselect dynamically change options

余生颓废 提交于 2019-12-09 03:23:15
问题 I have a dijit.form.FilteringSelect component and I want to change the options dynamically. But I get the store from the dijit.form.FilteringSelectwith its store property; there is no setter function in the store. (It may be a dojo.store.Reader) So how can I change the option of dijit.form.FilteringSelect ? Should I change it directly with DOM? Is there any way to update the store behind dijit.form.FilteringSelect ? 回答1: there is two type of data store in dojo: dojo.data.ItemFileReadStore -

Dojo: Get ID of inlineEditBox on OnChange

白昼怎懂夜的黑 提交于 2019-12-08 23:04:38
I'm using dojo and dijit and have an inlineEditBox widget. I'm trying to capture the onchange event and send a key/value post to a php page (to set into a database). The value is the new value just submitted, available from e.target.value. That's easy. I'd like the key value to be the id of the inlineEditBox widget. How can I access that programatically? Since InlineEditBox is a widget it's best not to monitor DOM level events. Instead, why not connect to InlineEditBox.onChange? For example: <span dojoType="dijit.InlineEditBox" ...> <script type="dojo/connect" event="onChange" args="value">

How do use dojo TextBox attr function to get value?

若如初见. 提交于 2019-12-08 19:48:01
问题 How can i get the value of a Dojo TextBox? Am doing this; dijit.byId("textName").getValue(); But firbug tells me getValue() is deprecated! is use attr('value')! but i have no clue on how to use attr('value') function Help Gath 回答1: Starting with Dojo 1.5 you should use the get and set methods to fetch and set properties. But the attr method is still working until Dojo 2.0 is out. var box = dijit.byId('textbox') box.get('value'); box.set('value', 'new value'); 回答2: I've done this and its