dojo

dojo how to override dijit class method

天大地大妈咪最大 提交于 2020-01-02 09:12:45
问题 I need to override onClick method in the Tree.js. Is there any common way to override dojo/dijit classes methods? 回答1: You could use: dojo.connect(tree, 'onClick', function(item) { /** Your Action **/ }); 回答2: I'm a bit confused, since you were already doing this in the last question you posted. You've got a few choices, depending on what you want to do. Clobbering method stubs In the case of true stubs like onClick , it's potentially as easy as clobbering that method on your widget instance.

Dojo: BorderContainer and ContentPanes not working inside of a custom widget template

吃可爱长大的小学妹 提交于 2020-01-02 08:44:09
问题 Hey guys, im trying to create some custom templated widgets with dijit.layout objects (BorderContainer, ContentPane) in the template, and i just can't get it to work. Maybe SO can steer me in the right direction... here's my code so far: test.html <html> <head> <title>Test Page</title> <style type="text/css"> @import "http://ajax.googleapis.com/ajax/libs/dojo/1.4.1/dojo/resources/dojo.css"; @import "http://ajax.googleapis.com/ajax/libs/dojo/1.4.1/dijit/themes/tundra/tundra.css"; html, body,

Dojo: BorderContainer and ContentPanes not working inside of a custom widget template

元气小坏坏 提交于 2020-01-02 08:43:57
问题 Hey guys, im trying to create some custom templated widgets with dijit.layout objects (BorderContainer, ContentPane) in the template, and i just can't get it to work. Maybe SO can steer me in the right direction... here's my code so far: test.html <html> <head> <title>Test Page</title> <style type="text/css"> @import "http://ajax.googleapis.com/ajax/libs/dojo/1.4.1/dojo/resources/dojo.css"; @import "http://ajax.googleapis.com/ajax/libs/dojo/1.4.1/dijit/themes/tundra/tundra.css"; html, body,

Dojo Dijit Dialog relative position. is it possible?

放肆的年华 提交于 2020-01-02 05:30:32
问题 I want to position Dojo's Dijit Dialog relative to one of my html element. is it Possible? If yes. How? currently it always shows dialog in middle of viewport. Can any one help me regarding the matter? Thanks. amar4kintu 回答1: Another way that I do this (not great because I override a private method but it gives me the flexibility I want): var d = new Dialog({ title:"Your Dialog", _position:function(){ if(this.refNode){ p = Geo.position(this.refNode); Style.set(this.domNode,{left:p.x + "px",

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

女生的网名这么多〃 提交于 2020-01-02 05:23:15
问题 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 header from the browser says: OPTIONS / HTTP/1.1 Host: myserver:12345 User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.8) Gecko/20100214 Linux Mint/8

Requirejs can't compile my dojo-dependent module

梦想的初衷 提交于 2020-01-02 05:01:16
问题 UPDATE: I tried Jeff Barczewski's answer below, and though I no longer get the error below for plugins, I am now getting a different error: Error: TypeError: Cannot read property 'normalize' of undefined In module tree: mymodule/core at Object.<anonymous> (/usr/local/lib/node_modules/requirejs/bin/r.js:1193:35) UPDATE 2: Since Jeff is correct that Dojo's plugins are not compatible with RequireJS, I decided to switch to using grunt-dojo instead for building dojo. I still use RequireJS for my

Programmatically set the selected value of a dijit Select widget

旧巷老猫 提交于 2020-01-02 01:55:09
问题 I'm populating a dijit select widget with options whenever another select widget's value changes. In my app, theres a dropdown menu for "Bus Route" and a dropdown menu for "Bus Stop". Users have assigned bus routes and stops that should be updateable. So when the page first loads, the route dropdown box has all routes available, and the route you are currently assigned to is the selected value. The stop menu is loaded with all stops associated with that route, but there is no selected value,

Height of tabContainers in dojo

和自甴很熟 提交于 2020-01-01 18:56:47
问题 I am using a Dojo tabContainer. The quick question: do you have to specify the widget size in pixel in the CSS, if you are dealing with a Dojo container? From what I am seeing, the only way to get a TabContainer to actually show is by giving it an absolute size via CSS. UPDATE: I figured out that the elements body and html were missing the height attribute, and therefore it was computed to 0. So, now if I set them as 100% I will display the form... but, it will be huge! (as long as the page).

Height of tabContainers in dojo

百般思念 提交于 2020-01-01 18:56:12
问题 I am using a Dojo tabContainer. The quick question: do you have to specify the widget size in pixel in the CSS, if you are dealing with a Dojo container? From what I am seeing, the only way to get a TabContainer to actually show is by giving it an absolute size via CSS. UPDATE: I figured out that the elements body and html were missing the height attribute, and therefore it was computed to 0. So, now if I set them as 100% I will display the form... but, it will be huge! (as long as the page).

How to update dojo tree data dynamically

空扰寡人 提交于 2019-12-31 14:45:14
问题 I would like to know how ot update the data of the dojo.dijit.tree component dynamically. At the moment I'm creating the tree using dojo.data.ItemFileReadStore and dijit.tree.ForestStoreModel. Once I create the tree, I would like to reload it periodically with new JSON data. This is how I create the tree at the moment: <div dojoType="dojo.data.ItemFileReadStore" jsId="myStore" url=getJSONResult></div> <div dojoType="dijit.tree.ForestStoreModel" jsId="myModel" store="myStore" query="{type:'cat