הוד בואר | 25 May 10:36 2015
Picon

How to cancel observation query?

Hi,

I have a store with observation. On the observation I'd create a query that returns me some result.
On this result I'm run an observe callback (see code below).
How can I cancel this observe? I found an example that called cancel() method, but according to the API this is not exists.

Any solution?

My code:
var s = dojo.store.Observable( new dojo.store.Memory(...) );
var r = s.query(...);
r.observe( function( record, dIndex, iIndex ) {...} );
// some stuff...
// how to cancel the observe?

--

-- 
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

Dojo-interest <at> mail.dojotoolkit.org
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
blu10 | 22 May 11:29 2015
Picon

dijit/TooltipDialog loses css classes after upgrading to 1.10

We upgraded to dojo 1.10 and now some of our pop up tooltips are no longer rendering correctly. we has custom styled them and the missing classes are messing up the look and feel
The two bolded classes below no longer appear in the rendered html of the widget after upgrading. 

Has anyone had this issue or know what might cause this... we havent changed anything in how we construct them.

<div lang="en-US" tabindex="-1" role="presentation" class="dijitTooltipDialog dijitTooltipABLeft dijitTooltipBelow" id="DelayedTooltipDialog_0" dir="ltr" widgetid="DelayedTooltipDialog_0"

now renders as 

<div lang="en-US" tabindex="-1" role="presentatio n" class="dijitTooltipDialog" id="DelayedTooltipDialog_0" dir="ltr" widgetid="DelayedTooltipDialog_0"
--

-- 
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

Dojo-interest <at> mail.dojotoolkit.org
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
Malcolm King | 22 May 03:52 2015

Highlighting Characters in a $Button label

Hi there,
I'm having trouble getting text to display "nicely" when using html tags in the label, e,.g
label:'<b><u>L</u></b>ogin' looks like text is aligned along the top of the characters not the bottom - this is even more pronounced and undesirable when the highlighted character is in the middle of the label.

Any suggestions on how I can get this to look better and align along the bottom of the letters?

Regards
Malcolm

 

Regards    

Malcolm

 

--

-- 
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

Dojo-interest <at> mail.dojotoolkit.org
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
DOJO | 21 May 13:55 2015
Picon

Get the local system date and Time format.

Hi,

is there any built-in/customized methods/classes, where I can get the
CultureInfo for the date and time of the system.

How can i read the shortDate/shortTime and longDate/londTime of the system
configurations.

I wanted to display date and time formats in my project same as system
formats.
I need to the dynamic date patterns set by system user. 

I am not looking for predefined formats which can be defined by code level.

--
View this message in context: http://dojo-toolkit.33424.n3.nabble.com/Get-the-local-system-date-and-Time-format-tp4006022.html
Sent from the Dojo Toolkit mailing list archive at Nabble.com.
--

-- 
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

Dojo-interest <at> mail.dojotoolkit.org
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest

Stuart Longland (VK4MSL | 16 May 23:53 2015

Chart displaying axes but not data

Hi all,

Maybe I've done something silly, but I'm having a hard time getting my
chart to display.  It shows the axes, but that's about it.  The actual
graph doesn't show up.

To put all in the picture, I'm attempting to make a clone of this site:
http://cycleroute.org/  The site's useful, but I've got some ideas that
I'd like to try out.  (Plus, I can't get in touch with the webmaster of
that site to share the ideas.)

The clone I'm working on is here for now:
http://www.longlandclan.yi.org/~stuartl/dojo/

I have managed to shoehorn the Google Maps API in, and so the map
appears in a ContentPane, there's a few panels around to allow for
future nativation, status, etc.  All good.

Down the bottom I've allocated a ContentPane for my chart.  So far, so
good.  I perform the requests, and Google out of the kindness of their
hearts hands me some JSON which gives me the elevation plot of the route
they just figured out for me.

Great.  Now I try to plot it.  This is where I come unstuck.  I'm using
a programmatic interface to create the graph, since the data is
collected after the user specifies the route.

I get back a list of objects that include latitude/longitude and
altitude.  I use their APIs to convert latitude/longitude into a
distance reading for the 'x' axis, and the altitude becomes the 'y'
axis.  I plonk these into a list of objects that looks like this:

[{x: 0, y: 10}, {x: 0.1, y: 10.2}, ...]

I figure out the minimum and maximum altitude as I work through this.
Finally, I call a plot() function that plots all this:

> 		function plot(elevations, minimum, maximum) {
> 			// Create the chart within it's "holding" node
> 			chart = new Chart("elevation");
> 
> 			// Set the theme
> 			chart.setTheme(ChartTheme);
> 
> 			// Add the only/default plot 
> 			chart.addPlot("default", {
> 				type: ChartTypeAreas,
> 				markers: true
> 			});
> 				
> 			// Add axes
> 			chart.addAxis("x");
> 			chart.addAxis("y", { vertical: true, min: minimum,
> 					max: maximum, fixLower: "major", fixUpper: "major" });
> 
> 			// Add the series of data
> 			chart.addSeries("Elevation",elevations);
> 
> 			// Render the chart!
> 			document.getElementById('elevation').innerHTML = '';
> 			chart.render();
> 		}

ChartTheme, Chart, and ChartTypeAreas are globals; initialised in the
dojo.require callback function:

> 	require([
> 			"dojo/parser",
> 			"dojox/charting/Chart",
> 			"dojox/charting/themes/Claro",
> 			"dojox/charting/plot2d/Areas",
> 			"dojox/charting/plot2d/Markers",
> 			"dojox/charting/axis2d/Default",
> 			"dijit/layout/BorderContainer",
> 			"dijit/layout/TabContainer",
> 			"dijit/form/Button",
> 			"dijit/form/TextBox",
> 			"dijit/layout/ContentPane",
> 			"dojo/domReady!",
> 	], function(parser, chart, chartTheme, chartTypeAreas){
> 		parser.parse();
> 		Chart = chart;
> 		ChartTheme = chartTheme;
> 		ChartTypeAreas = chartTypeAreas;
> 
> 		plot([{x:0,y:0},{x:1,y:10},{x:2,y:0}],0,10);
> 	});

You'll also note here I try to plot a graph with some dummy data to test
things.

Despite all this, I seem to get no chart series actually appearing.
I've tried swapping things around, but I'm at a loss.  There's no error
in the console, just a flat out refusal to display the chart.

Did I miss something?
-- 
Stuart Longland (aka Redhatter, VK4MSL)

I haven't lost my mind...
  ...it's backed up on a tape somewhere.
--

-- 
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

Dojo-interest <at> mail.dojotoolkit.org
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest

Dominic Shelter | 16 May 12:31 2015
Picon

can't derive from dijit/Tree (TypeError: this._attachPoints is undefined)

Hello,
I am trying to build my own Treewidget based on dijit/Tree to include extra functionality.
When I create a dijit/Tree everything is fine, but if I create an object of my own class, derived from Tree, I get the error:
TypeError: this._attachPoints is undefined

What is wrong? You can run my attempt at http://jsfiddle.net/v5fd7ptc/1/
What I am trying is basically as follows:

html:
<div id="tree">Tree goes here ...</div>

js:
require([...,'dojo/domReady!'],
  function (...) {
    declare("MyTree", Tree, {
        "-chains-": {
            constructor: "manual"
        },
        constructor: function () {
          ...
          this.inherited(arguments, [...,"tree"]);
        }
    }
    var t=new MyTree();
});

Cheers
Dominic
--

-- 
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

Dojo-interest <at> mail.dojotoolkit.org
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
demisheep | 15 May 18:06 2015
Picon

Can I setup my ComboButton to do a onClick when the user selects a value in the drop down list?

I think I may be using the wrong dojo widget. I just need a drop down list
really, but currently have setup a ComboButton. Can I setup an onClick or
onSelect of some sort when the user picks an option inside the ComboButton
down down menu? My current onClick is picking up when the user clicks on the
text area button. I want an onClick or onSelect action after the user clicks
the down arrow button and then selects an option.

--
View this message in context: http://dojo-toolkit.33424.n3.nabble.com/Can-I-setup-my-ComboButton-to-do-a-onClick-when-the-user-selects-a-value-in-the-drop-down-list-tp4006013.html
Sent from the Dojo Toolkit mailing list archive at Nabble.com.
--

-- 
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

Dojo-interest <at> mail.dojotoolkit.org
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest

Dominic Shelter | 15 May 11:12 2015
Picon

Dijit-Tree shows wrong tree representation after failed PUT request

Hello,
I am using a modified version of the example "Dynamic Updates and Drag & Drop" in "Connecting a Store to a Tree" at https://dojotoolkit.org/documentation/tutorials/1.10/store_driven_tree/index.html.

I have replaced the Memory "governmentStore" with a cached JSONRest store, connected to my REST server. Most functions work fine. However, there are situations, where the server shouldn't accept certain drag&drop operations (for example, there are two types of tree items, call them "folders" and "files". When an item is dropped onto a "file", which cannot carry any children, the server considers the attempt as unsupported operation and responds with BAD_REQUEST status code.)

Although the server responds with "BAD_REQUEST", the tree visualizes the failed drag&drop as if it had succeeded, showing the dropped item as child of the "file" item.

How can the server inform the client that the drag&drop has failed, and that the displayed tree should remain the same as it was before the drag&drop attempt?

(It doesn't help to use information on the client side, which tree items are valid targets for the drag&drop. Only the server knows, which items are valid targets at a specific time, and the allowed targets can change from one second to the next - the "folder" and "file" example above is not the complete picture, the real situation is more abstract.)

Cheers
Dominic
--

-- 
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

Dojo-interest <at> mail.dojotoolkit.org
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
tk8ykex5z5 | 14 May 23:50 2015

Select that can return an object for its value

I've kind of got the Select widget working the way I want (see
http://dojo-toolkit.33424.n3.nabble.com/Select-in-a-Form-in-a-template-tp4006004.html),
but I'd really like something like it that can return an object instead of
just a string value.  

I'm populating a form from a complex JSON object returned from a Spring
service.  The values used to populate the Select fields are also objects
(not just a value and label).  When the form is edited, I'd like to just
grab the form's value and send it back to my Spring service to be saved.

Unfortunately, the dijit/form/Select widget will only take and return a
simple value (string or number) and not an object.  

Is there a similar Select widget that can handle an object as its value?  I
just want to check before I try my hand at customizing the Select widget.   

Thanks,
Brian

--
View this message in context: http://dojo-toolkit.33424.n3.nabble.com/Select-that-can-return-an-object-for-its-value-tp4006009.html
Sent from the Dojo Toolkit mailing list archive at Nabble.com.
--

-- 
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

Dojo-interest <at> mail.dojotoolkit.org
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest

demisheep | 14 May 15:41 2015
Picon

How do I use the Edit module with the cellWidget to allow any of my cellWidget dojo components (dropdown, buttons, etc) to write to the store automatically?

I am trying to get the Edit module working with my cellWidget objects. The
documentation states that if you set this up, all cellWidgets can write to
the store automatically when edit is completed. I need to figure out how to
setup my code to get it to work.

Here is the Edit Module documetnation and an excerpt:

https://github.com/oria/gridx/wiki/Module-Edit
<https://github.com/oria/gridx/wiki/Module-Edit>  

"When a cell is to be edited, a new instance of Dojo widget (Dijit) is
created at the location of the cell on the screen. This widget is
responsible for showing the current value and allowing the user to change
that value. By default, the widget used is an instance of dijit.form.TextBox
however different widget types can be used. The property called editor
should be set to the String name of the Dijit class to be used. Remember to
define an AMD include of this class type if it is used. Another column
property called editorArgs can be used to supply properties to the widget
named in editor."

I've tried it with and without the editorArgs with the same results. I think
I don't have something setup correctly.

My code:

            { id: 'identColumnId', field: 'identColumn', name: 'Ident',
width: '77px',
                editable: true,
                editor: 'dijit/form/ComboButton',
                // editorArgs:{
                //     props:'store: identMemStore'
                // },
                widgetsInCell: true,
                navigable: true,
                setCellValue: function(one,two,cellWidget){
                    var rowIndex = cellWidget.cell.row.id;
                    var toggle = identMemStore.get(rowIndex).identColumn;
                    if (toggle)
                    {
                        this.identColumn.set('label', "Override");
                        this.identColumn.set("checked",false);
                    }else
                    {
                        this.identColumn.set('label', "Use Input");
                        this.identColumn.set("checked",true);
                    }
                },
                getCellWidgetConnects: function(cellWidget, cell){
                    // return an array of connection arguments
                    return [
                        [cellWidget.identColumn, 'onClick', function(e){
                            var rowIndex = cellWidget.cell.row.id;
                            var curValue =
identMemStore.get(rowIndex).identColumn;

                            if (curValue === true){
                                cellWidget.identColumn.set('label', "Use
Input");
                                cellWidget.identColumn.set("checked",true);
            // Write to store manually...
                                //
identMemStore.data[rowIndex-1].identColumn = false;
                            } else if (curValue === false){
                                cellWidget.identColumn.set('label',
"Override");
                                cellWidget.identColumn.set("checked",false);
            // Write to store manually...
                                //
identMemStore.data[rowIndex-1].identColumn = true;
                            } else {
                                console.log("ERROR");
                            }                                    
                        }]
                    ];
                },
                decorator: function(){
                    return "<button data-dojo-type='dijit/form/ToggleButton'
data-dojo-attach-point='identColumn' ></button>";
                }
            },

--
View this message in context: http://dojo-toolkit.33424.n3.nabble.com/How-do-I-use-the-Edit-module-with-the-cellWidget-to-allow-any-of-my-cellWidget-dojo-components-dropd-tp4006006.html
Sent from the Dojo Toolkit mailing list archive at Nabble.com.
--

-- 
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

Dojo-interest <at> mail.dojotoolkit.org
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest

tk8ykex5z5 | 13 May 23:42 2015

Select in a Form in a template

I'm trying to add a dijit/form/Select to a form that's in a template.  The
form's been working fine with "dijit/form/Textbox" and
"dijit/form/SimpleTextarea" widgets.  

Now I want to add a "dijit/form/Select".  The control appears, but only the
first option appears, and clicking on the arrow does nothing.

I've tried using a Memory store that holds data from a Spring web service. 
When that didn't work, I tried populating an array from the data and setting
the select widgets "options" property.  Both had the same behavior (only the
first option appears).  When I look at the generated html, I can only see
the first option.

I'll just talk about the Memory store approach here.  I used this as a
reference:
https://dojotoolkit.org/documentation/tutorials/1.10/selects_using_stores/

The data from my web service looks like this:

I want to use the "name" property from the array for the option label. I'd
like to use the "id" property for the value, but I read in the documentation
that non-string properties don't work with Select.  That's okay, since the
"name" property is unique and I can use it as the value as well.

Here's the relevant piece of my template:

(Note that "agency" from my form value has the same structure as those I use
to populate the Select - see above.  I tried using name="agency", too, but
that didn't seem to make any difference.  Not sure that's relevant.  I'd be
*really* happy to just get the select to populate first, then worry about
whether it selects the right option using the form value later).

Here's how I populate the select:

Note that "result" is the array described above. 

I don't see any errors in the console.

Should "dijit/form/Select" work inside a form in a template?  Am I missing
something?

Thanks,
Brian

--
View this message in context: http://dojo-toolkit.33424.n3.nabble.com/Select-in-a-Form-in-a-template-tp4006004.html
Sent from the Dojo Toolkit mailing list archive at Nabble.com.
--

-- 
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

Dojo-interest <at> mail.dojotoolkit.org
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest


Gmane