dojo

Avoid “destroying non-socket.io upgrade” error

为君一笑 提交于 2019-11-30 23:42:45
I am trying to make a socket.io based server but whenever I connect by client to it using dojo, it shows me this error: debug - destroying non-socket.io upgrade Here's my server code var express = require("express"); var io = require("socket.io"); server= express.createServer(); var server_socket = io.listen(server); server_socket.sockets.on("connection",function(socket) { console.log("connection established"); socket.emit("message", message); }); server.listen(8080); And here's my client code require(["dojox/socket"], function (socket) { var args, ws = typeof WebSocket != "undefined"; var

Binding real number values to Grails domain attributes (values sent by Dojo widgets)

陌路散爱 提交于 2019-11-30 22:24:04
I am using Dojo 1.9 with Grails 2.3.9. The Dojo NumberTextBox widget - that I use in my forms - sets real number values (e.g.: 12.56) in a fixed format (the JavaScript base format) into the HTML form input fields (but displays/edits them according to the browser locale, so the user always sees properly formatted numbers). Grails on the other hand expects the input fields to be formatted according to the browser locale. This results in a conversion mismatch and the effect is that Grails loses the decimal places when the browser locale is not English and saves the record incorrectly to the

Difference between programmatically vs declaratively created widgets in dojo?

有些话、适合烂在心里 提交于 2019-11-30 20:38:01
I know in dojo we can create any widgets in two ways, programmatically declaratively To create widgets programmatically we'll use JavaScript, whereas for declaratively we'll use dojo attributes in HTML tags. Can someone explain me what are the differences between them? which one is mostly preferred and why? Difference Well, there are certain differences between both ways. In the declarative way, all configuration is based upon HTML attributes like dojo-data-props but also some other attributes like the value, title, ... . So the DOM node you create actually serves as some kind of placeholder.

Automatically Resize dojo dijit.Grid widget when it's parent container resizes

好久不见. 提交于 2019-11-30 20:13:59
I have a dojo Grid widget inside a TitlePane with it's width set to 100%. The TitlePane is in a liquid layout so it's width changes with the browser window size. The problem I am having is that when the parent window expands (or contracts) the grid itself does not change it's width. I can get it to resize itself by calling render() on the grid, but how can I detect that the parent window has resized so that I know to redraw the grid widget? Rylee Corradini I've had to do this on occasion; it's not too tough: function resizeGrid() { // do whatever you need here, e.g.: myGrid.resize(); myGrid

How to query a dgrid on multiple columns

℡╲_俬逩灬. 提交于 2019-11-30 20:08:55
问题 Is it possible to create a dgrid query that will search for a regex string on more than one column? Usually the syntax specifies {column1: "foo", column2: "foo"} but that will look for rows where both column1 AND column2 are "foo". But I want to use the same search string against both columns... is that possible and how would I do it? I need something like {column1 || column2 : "foo"}. 回答1: You can write your own function as I mentioned in my answer to your previous question Is it possible to

export/convert chart from dojo charting to image

邮差的信 提交于 2019-11-30 18:06:21
问题 can anyone tell me if it is possible to convert a dojo charting object into an îmage file? I need this as I want to export an Excel file from a webpage containing some data and the representing chart. The only thing I found is http://dojotoolkit.org/reference-guide/dojox/gfx/utils/toSvg.html#dojox-gfx-utils-tosvg but I do not really know how to proceed with the output of that function. Thanks you! 回答1: What you found will work as long as you know what to do with SVG (e.g., rasterize it using

Avoid “destroying non-socket.io upgrade” error

浪尽此生 提交于 2019-11-30 18:06:21
问题 I am trying to make a socket.io based server but whenever I connect by client to it using dojo, it shows me this error: debug - destroying non-socket.io upgrade Here's my server code var express = require("express"); var io = require("socket.io"); server= express.createServer(); var server_socket = io.listen(server); server_socket.sockets.on("connection",function(socket) { console.log("connection established"); socket.emit("message", message); }); server.listen(8080); And here's my client

Binding real number values to Grails domain attributes (values sent by Dojo widgets)

ε祈祈猫儿з 提交于 2019-11-30 18:01:07
问题 I am using Dojo 1.9 with Grails 2.3.9. The Dojo NumberTextBox widget - that I use in my forms - sets real number values (e.g.: 12.56) in a fixed format (the JavaScript base format) into the HTML form input fields (but displays/edits them according to the browser locale, so the user always sees properly formatted numbers). Grails on the other hand expects the input fields to be formatted according to the browser locale. This results in a conversion mismatch and the effect is that Grails loses

DOJO error when using this.inherited(arguments) in strict mode

為{幸葍}努か 提交于 2019-11-30 15:36:12
I am declaring a base "Class" for a Dijit Custom widget. When in 'strict mode' routine this.inherited(arguments) ; is being called, I receive this error: Uncaught TypeError: 'caller', 'callee', and 'arguments' properties may not be accessed on strict mode functions or the arguments objects for calls to them I need to keep the usage 'strict mode'. Any idea how to solve it? define([ 'dojo/_base/declare', 'dojo/topic', 'dojo/_base/lang' ], function ( declare, topic, lang ) { 'use strict'; var attachTo = 'myPanels'; return declare(null, { id: null, title: null, postCreate: function () { // ERROR

How to redirect with JQuery, load another page but sent some POST parameters in request?

拈花ヽ惹草 提交于 2019-11-30 15:18:06
How do I redirect using either JQuery, DOJO or plain JavaScript, load another page but sent some POST parameters in request? This should work, but i haven't tested it: function postData(url, data) { var form = $('<form></form>'); $(form).hide().attr('method','post').attr('action',url); for (i in data) { var input = $('<input type="hidden" />').attr('name',i).val(data[i]); $(form).append(input); } $(form).appendTo('body').submit(); } Basically you can create a form on the fly and submit it. Unfortunately you can not POST stuff directly from script. You can't redirect with postdata using