dojo

How to make dojo.request.xhr GET request with basic authentication

久未见 提交于 2019-12-07 08:02:26
问题 I look at the documentation for Dojo v.1.9 request/xhr and I cannot find example that includes basic authentication. How and where do I include the User name and Password in the Dojo XHR options? require(["dojo/request/xhr"], function(xhr){ xhr("example.json", { // Include User and Password options here ? user: "userLogin" password: "userPassword" handleAs: "json" }).then(function(data){ // Do something with the handled data }, function(err){ // Handle the error condition }, function(evt){ //

Using requirejs with dojo 1.9.1

不问归期 提交于 2019-12-07 07:51:45
问题 Can anybody provide me with a simple example of how to use requirejs to load dojo modules? The requirejs.org website indicates it is best to use the dojo loader until a ticket is resolved - but that ticket appears to be resolved and is now closed. I am encountering errors such as described here (duplicated below) only now with dojo 1.9.1. Error: TypeError: _3.add is not a function _3.add("dom-addeventlistener",!!document.addEventListener); (I have an existing backbone app that uses requirejs

DOJO: Lazy loading nodes in LazyTreeGrid - looking for example code

蓝咒 提交于 2019-12-07 07:31:03
问题 I'm looking for an example of how to use QueryReadStore (or some other store) with dojox.grid.LazyTreeGrid ? I want to be able to display big structures and load only necessary required data from server. Only children of open nodes should be loaded from dedicated server script. I'm already using QueryReadStore with dojox.grid.DataGrid and it works great :) Help, Thanks. 回答1: Here is a long-winded explanation/sample based on some stuff I am currently doing. This assumes basic comfort with Dojo

How to set Arcgis Javascript dojoConfig relative path of packages

喜夏-厌秋 提交于 2019-12-07 06:55:01
问题 I am using Arcgis Javascript API. API is built on dojo toolkit. So I need to use dojo features in API. I am preparing dojo config file as following. var pathRegex = new RegExp("/\/[^\/]+$/"); var locationPath = location.pathname.replace(pathRegex, ''); var dojoConfig = { async: true, parseOnLoad: false, baseUrl:"js/", packages: [ { name: "application", location: locationPath + '/js/application' }] }; I created a bootstrapper.js like following. require(["application/main", "dojo/domReady!"],

How do you conditionally style a cell in a Dojo data grid?

∥☆過路亽.° 提交于 2019-12-07 06:04:07
问题 Essentially what I want to do is to apply additional CSS classes to individual cells in a data grid based on the value of the cell. An example would be to color the text red when a dollar value is negative. The only solution I've found was to use the formatter of the column to create a string for a span that has the class based on the value passed in. I figure there has to be a better way. 回答1: When specifying the structure, you pass in an object that represents the widget configuration for a

Dojo: dojo onblur events

会有一股神秘感。 提交于 2019-12-07 05:55:33
问题 I have a form setup with dojo 1.5. I am using a dijit.form.ComboBox and a dijit.form.TextBox The Combobox has values like "car","bike","motorcycle" and the textbox is meant to be an adjective to the Combobox. So it doesn't matter what is in the Combobox but if the ComboBox does have a value then something MUST be filled in the TextBox. Optionally, if nothing is in the ComboBox, then nothing can be in the TextBox and that is just fine. In fact if something isn't in the Combobox then nothing

Set query to search all fields of a dojo datagrid

我是研究僧i 提交于 2019-12-07 05:47:44
问题 I have a Dojo DataGrid with several fields. I'm currently setting the query to search one field at a time, like so: grid.setQuery( {name:"Bob"}, {ignoreCase:true} ); However I would like the query to search all the fields at once. For example say I have three fields titled "name", "friend", "family". Let's say I only want the rows that contain "Bob" in any of the three fields to show in the grid. How would I got about doing that without three separate queries? Any help is appreciated. 回答1: Is

JavaScript/Dojo Module Pattern - how to debug?

不打扰是莪最后的温柔 提交于 2019-12-07 05:40:23
问题 I'm working with Dojo and using the "Module Pattern" as described in Mastering Dojo. So far as I can see this pattern is a general, and widely used, JavaScript pattern. My question is: How do we debug our modules? So far I've not been able to persuade Firebug to show me the source of my module. Firebug seems to show only the dojo eval statement used to execute the factory method. Hence I'm not able to step through my module source. I've tried putting "debugger" statements in my module code,

applying css to dijit button

て烟熏妆下的殇ゞ 提交于 2019-12-07 03:01:20
问题 I have the following HTML and CSS: <button id="myBtn" dojoType="dijit.form.Button">Testing</button> #myBtn { margin-left: 100px; } The CSS is supposed to push the button in 100px . But since dijit applies some extra layers of HTML around the button, the button gets a 100px padding. JSbin to show the problem edit: Found one (not IE6-compatible) solution: [widgetid=myBtn] { margin-left: 100px; } 回答1: see above :-) Surround with a DIV and use that DIV in your static CSS. I think decorating with

onchange wont fire after programmatically changing html select dropdown

邮差的信 提交于 2019-12-07 02:40:05
问题 I have a select inside HTML <select id="league" name="league"> which I'm listening for changes inside my javascript. var league = dojo.byId("league"); dojo.connect(league, "onchange", function (evt) { //do stuff } Which works fine. However I have a link that I can click which updates the select: <a href=javascript:void(0) onclick="updateSelection(league);"> League </a> The link works as it updates the selected value of the select with the following function. function updateSelection(NewLeague