dojo

Add a row in Dojo datagrid

自闭症网瘾萝莉.ら 提交于 2019-12-05 14:05:40
Struggling to find a bit of code to easily understand. How do you add a row and clear all rows in a Dojo datagrid (version 1.4.2). Lets say the data is 2 columns with customerID and address. I am using dojo.data.ItemFileWriteStore to store values in - but again not quite sure how this should be used. It can't be that hard. Cheers. You can get the data store reference from the grid using grid.store , then you can use store.newItem() to create a new item in the store. This new item is added as a new row in the grid. For example, store.newItem({customerID : 1, address : "Somewhere"}) . To clear

dijit filteringSelect with min length

蓝咒 提交于 2019-12-05 13:05:54
I can't seem to find a way to require the filtering select input to be of a certain length. I've tried like this: new dijit.form.FilteringSelect({ 'name': 'bla', 'store': jsonRestStore, 'searchAttr': "name", 'pattern': '.{3,}', 'regExp': '.{3,}' }); but it doesn't change a thing. I want the filtering select to only query the store, if at least 3 characters have been entered. Can't be that exotic a requirement, can it? There are thousands of items behind that store, so querying that with just 1 or 2 characters is slow. I did a bit more searching and found this post on the dojo mailing list. To

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

若如初见. 提交于 2019-12-05 13:00:32
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 (Helena) Firefox/3.5.8 (.NET CLR 3.5.30729) Accept: text/html,application/xhtml+xml,application/xml;q=0

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

為{幸葍}努か 提交于 2019-12-05 12:55:52
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. Here is a long-winded explanation/sample based on some stuff I am currently doing. This assumes basic comfort with Dojo 1.7-style packages (for instance, we assume the default Dojo packages are correctly set-up). Client-side

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

一世执手 提交于 2019-12-05 12:35:55
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){ // Handle a progress event from the request if the // browser supports XHR2 }); }); Thanks. Indeed, you

Dojo Dijit Dialog relative position. is it possible?

对着背影说爱祢 提交于 2019-12-05 12:32:51
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 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", top:p.y + "px"}); } }, showAround:function(node){ this.refNode = node; this.show(); } }); d.showAround(dojo

How to set Arcgis Javascript dojoConfig relative path of packages

喜你入骨 提交于 2019-12-05 12:09:29
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!"], function (application) { console.log("bootstrapper is running"); application.Run(); }) And index.html

Explain this confusing dojo tutorial syntax for declare

梦想的初衷 提交于 2019-12-05 11:42:27
I am reading the syntax for using dojo's declare for class creation. The description is confusing: The declare function is defined in the dojo/_base/declare module. declare accepts three arguments: className, superClass, and properties. ClassName The className argument represents the name of the class, including the namespace, to be created. Named classes are placed within the global scope. The className can also represent the inheritance chain via the namespace. Named Class // Create a new class named "mynamespace.MyClass" declare("mynamespace.MyClass", null, { // Custom properties and

How to add a div dynamically by using Dojo?

柔情痞子 提交于 2019-12-05 11:40:32
I have a the following static div: <body> <div id="div1"></div> .... I want to add a div with id "div1_1" within div1 dynamically by using dojo. How can I do it? You can do it using just Dojo Base — no need to include anything, if you use the trunk or Dojo 1.3: dojo.create("div", {id: "div1_1"}, "div1"); This line creates a div with id "div1_1" and appends it to the element with id "div1". Obviously you can add more attributes and styles in one go — read all about it in the documentation for dojo.create() . Another option using flexible dojo.place : dojo.place("<div id='div1_1'></div>", "div1"

Javascript form.submit() not working in Firefox

耗尽温柔 提交于 2019-12-05 11:31:21
问题 There are several questions/answers on this here, here and here and elsewhere, but they all seem JQuery specific and do not appear to apply to this (for example, I am NOT creating a new Form object, this is an existing form in the document. Also I am NOT using Jquery at all). I have a form which has to be modified before submission for reasons of IE7 compatibility. I have to strip out all the BUTTON tags from my form and then add a hidden field, but this is all in an existing form on the