dojo

What is the Dojo equivalent of jQuery's scope attribute?

Hi. I'm a Dojo n00b. In jQuery, a DOM node or jQuery object can be passed as an attribute in a query, which sets the scope: var myScope = $('#someDiv'); $('a',myScope).addClass('red'); $('li',myScope).css('display','inline'); Now, in Dojo I can chain several .query()s after each other, but what should I do if I have a certain DOM nod...

Is there a way to efficiently update one value in dojo chart2d?

I am looking for a way to update one and only one value in a dojox chart2d. There is a way to update an entire series, which involves mychart.updateSeries("myseriesname",array_of_data) mychart.render() but This is too slow for my application. What I want to do is be able to drag the mouse over a vertical bar chart and have the valu...

How to create a new widget for dojox.grid.cells.dijit?

I am trying to create a button widget for dojox.grid. My problems are: 1) The button is only shown when I double click the grid. 2) I can't figure out how to set attributes through declarative markup. It seems that the markupFactory function is responsible for it but it doesn't set the widget's label. The following code demonstrates what...

Dojo: dijit.form.DropDownButton content not positioned correctly

I have the following setup: <div dojoType="dijit.form.DropDownButton"> <span>Modify</span> <div dojoType="dijit.Menu"> <div dojoType="dijit.MenuItem">...</div> </div> </div> There is of course more to the final setup. The problem I Have is that if I scroll in the page, the popup menu under the DropDownButton comes much highe...

Is there a Markdown editor for Dojo

Is there a good Markdown editor for Dojo? I have seen Control.TextArea (based on Prototype) and Stack Overflow's reverse-engineered version of WMD (seems to rely on jQuery) but I'd rather use a Dojo-based tool, as my site already uses this framework. Does such a tool exist? Googling for dojo markdown editor doesn't seem to return any u...

Use Dojo Drag and Drop together with Dojo Moveable

Hi, I'm using Dojo.dnd to transfer items between to areas. The problem is: the items will snap into place once I drop them, but I'd like to have them stay where I drop them, but only for one area. Here's a little code to explain this better: <div id="dropZone" class="dropZone"> <div id="itemNodes"></div> <div id="targetZone"...

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

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 ...

dijit.form.DateTextBox setting values

I have following text field with dojo dojo Date text type. dojoType="dijit.form.DateTextBox" required="true"/> I use the following code to set the dijit.form.DateTextBox value dijit.byId('dtinv').attr('value',new Date(tList[i].getAttribute("dtinv"))) ; tList[i].getAttribute("dtinv") has value 2010-04-02 When the v...

I can't get onChange to fire for dijit.form.Select

I seem unable to correctly attach the onchange event to a dijit.form.Select widget. However, I am new to web development, so I could be doing something completely idiotic (although, as best I can tell (and I've read all the docs I could find) I'm not). I made sure the body class matches the dojo theme, that I dojo.require() for all the w...

Changing constraints on the fly

Hi, I have a dijit.form.NumberTextBox input field that starts out with these parms: new dijit.form.NumberTextBox({ id: din1, style: "width:60px", constraints: { places: 0, pattern: '######' } }, din1); Everything works great..My question is I would like to change 'places' and 'pattern' parms...

dojo.io.iframe erroring when uploading a file

Hi, Hit an interesting problem today when trying to upload an image file < 2MB using dojo.io.iframe. My function to process the form is called, but before the form is posted to the server I am getting the following error: TypeError: ifd.getElementsByTagName("textarea")[0] is undefined My function that is used to action the post of ...

How to respond to HTTP OPTIONS request on a JSON-RPC server

My JSON-RPC client (browser using dojo JSON-RPC) makes a JSON-RPC request (dojo.callRemote) to my JSON-RPC server on myserver.com/12345 (Python 2.5, SimpleJSONRPCServer). The server then gets a HTTP request with header "OPTIONS / HTTP/1.1", which it can't handle by default, so I wrote a custom handler for this request. The request hea...

Dijit.Dialog 1.4, setting size is limited to 600x400 no matter what size I set it.

I'm trying to set the size of a dijit.Dialog, but it seems limited to 600x400, no matter what size I set it. I've copied the code from dojocampus and the dialog appear, but when i set the size larger, it only shows 600x400. Using firebug and selecting items inside the dialog, I see that they are larger than the dialog, but don't show c...

Dojo load time extremely slow on iis

I am currently working on a project that is using Dojo as the js framework. Its a rather rich ui and as such is using (and thus loading) a lot of different .js files for the dojo plug-ins When run on an apache server running on a mac, the files (all around 1k) are served very quickly (1 or 2 ms) and the page loads pretty fast (<5 second...

How to add Dojo tree right click context menu only for the root? not for remaining children..

Hi, I have created a tree using dojo. I want to add right click context menu on the root of the tree. Following is the code <head> <link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/dojo/1.3/dijit/themes/tundra/tundra.css"&gt; <style type="text/css"> body, html { font-family:helvetica,ar...

Dojo Widgets not rendering when returned in response to XhrPost

I am trying to capture the selected item in a Dijit Tree widget to render remaining part of the web page. Here is the code that captures the selected item and sends it to Django backend: <div dojoType="dijit.Tree" id="leftTree" store="leftTreeStore" childrenAttr="folders" query="{type:'folder'}" label="Explorer"> <script typ...

Dojo not working for me.

Hello, I can't get my dojo working. I've tried everything. Here is the code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt; <html> <head> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/dojo/1.4/dojo/dojo.xd.js"&gt; dojo.addOnLoad(functio...

Lazy loading dojo modules: does dojo check its cache?

When evaluating dojo.require statements, dojo tracks which modules and resources have been required and doesn't download them many times, but takes them from cache. But what if I require a module lazily, for example, when a button is clicked, - does dojo check its cache? ...

Dojo reading a json file from a local filesystem using dojo.xhrGet

Hello, I'm trying to read a file from a local filesystem. I do not have a server at my disposal and thus i'm trying to do it this way. Here is what I got so far; function init(){ netscape.security.PrivilegeManager.enablePrivilege('UniversalBrowserWrite'); dojo.xhrGet( { url: "/json/coursedata.json", handle...

basic javascript DOJO 1.4 installation not working

I am trying to give the DOJO framework a test spin but some how the latest release does not work at all ( 1.4.2) I keep getting a "console[_8]" [undefined] is not an object error. this is on the demos as well 1.3.3 works fine it seems ( or at least i dont get that error so far) any ideas? I have been using jquery for a while and love i...