dojo

How to load a JS file that is not a module in dojo?

前提是你 提交于 2019-12-05 11:14:33
I'll start by saying that I am a javascript and dojo noob. However, I have been working on writing some unit tests for my js code, using the D.O.H framework. One thing I noticed is that the framework does not seem to have a way to mock XHR requests. So I decided to use sinon for the mocking. Heres my question, I cannot successfully load the sinon code into my dojo module. Here is what I tried: define(["doh/runner", "tests/sinon-1.4.2"], function(doh, sinnon) { ... }); I have the tests package mapped to the correct directory, and can load other files from there. So how do I go about loading

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

左心房为你撑大大i 提交于 2019-12-05 10:45:05
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. When specifying the structure, you pass in an object that represents the widget configuration for a given column. As part of this object, include a formatter function in the definition: { ... formatter:

Dojo: dojo onblur events

我怕爱的太早我们不能终老 提交于 2019-12-05 10:05:41
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 MUST be in the text box. In regular coding I would just use an onBlur event on the text box to go to a

onchange wont fire after programmatically changing html select dropdown

血红的双手。 提交于 2019-12-05 09:25:43
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){ dojo.byId('league').value = NewLeague; // works dojo.byId('league').onChange; //this isnt working /

How to update a Dojo Grid cell value using a TooltipDialog (and DropDownButton)

梦想与她 提交于 2019-12-05 09:05:56
问题 I have a dojo grid which is using some editable dijit form fields. All is well, until I try ot implement an country (multi) select cell as an Tooltip Dialog; i.e., show a drop down button which opens the tooltip dialog populated with a checkbox array to select one or more country. Once checked and clicked OK, the cell should update with a list of selected countries. Obviously I'll take care of updating the server via the store later on. I've implemented a country select tooltip dialog which

JavaScript/Dojo Module Pattern - how to debug?

与世无争的帅哥 提交于 2019-12-05 08:57:09
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, and Firebug seems to halt correctly, but does not show the source. Contrived example code below. This

Set query to search all fields of a dojo datagrid

烈酒焚心 提交于 2019-12-05 08:32:24
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. Kevin Is your store an ItemFileReadStore or a QueryReadStore ? If ItemFileReadStore you may be able to utilize

Error: multipleDefine from Dojo & jQuery-UI conflict

眉间皱痕 提交于 2019-12-05 08:00:57
I am trying to create an editable SlickGrid (which uses jquery-ui) and also use Dojo. When my page contains <script src="../../bower_components/dojo/dojo.js"></script> <script src="../../bower_components/SlickGrid/lib/jquery-ui-1.11.3.js"></script> <script src="../../mlads/fillDemo/FillDemo.js"></script> the console shows Error: multipleDefine return mix(new Error(error), {src:"dojoLoader", info:info}); dojo.js (line 106) src: dojoLoader dojo.js (line 1896) info: Object { pid="dijit", mid="dijit/_WidgetsInTemplateMixin", pack={...}, more...} If I comment out the jquery-ui line, the error goes

Dojo “loading”-message

微笑、不失礼 提交于 2019-12-05 07:38:08
I'm new to Dojo, so I need a little help. Some of my links takes a while (when the user clicks, it takes several seconds before the page starts loading), and I'd like to add a "loading"-message. I can do it the "old fashion way", but I want to learn the new, easier, smarter Dojo-way. Exactly how it works is not important right now, but I imagine something like this: A rectangle appears in the middle of the browser-windows. (Not the middle of the document.) It has an animated gif, and a message like "Please wait...". All other elements are disabled, maybe "faded out" a bit. Maybe a big white 50

Exporting a dojo datagrid to a CSV file

末鹿安然 提交于 2019-12-05 07:25:12
问题 I am looking to get a Javascript function which will export my datagrid (zero.grid.DataGrid) full of data into a CSV file or something similar which can be opened by a spreadsheet application. Is there any standard way of doing this out there.. 回答1: I had tough time with using Exporter plugin with EnhancedGrid using servlet as backend. Finally I made it work by using iFrame: <!DOCTYPE HTML> <html lang="en"> <head> <meta charset="utf-8"> <title>CISROMM - Master Milestone List Editor</title> <!