Guru | 24 Apr 07:21 2014
Picon

Lazy tree grid editing issue

Hi I am trying example for editable lazy tree grid. When I am trying to edit label cell's, I am getting assertion failed error. Please find the code below. var data = { identifier: 'name', label: 'name', items: [ {name:'IBM',type:'COMPANY',children:[ {name:'S&D',type:'DEPT'}, {name:'GTS',type:'DEPT'}, {name:'GBS',type:'DEPT'}, {name:'ISL',type:'DEPT'} ]}, {name:'Infinite', type:'COMPANY',children :[ {name:'IBMBU',type:'DEPT'}, {name:'VERIZON',type:'DEPT'}, {name:'HR',type:'DEPT'} ]}, {name :'MINDTREE', type:'COMPANY',children :[ {name :'T&T',type:'DEPT'}, {name:'CORE',type:'DEPT'} ]} ] }; require(['dojox/grid/LazyTreeGrid','dojo/data/ItemFileWriteStore','dojox/grid/LazyTreeGridStoreModel','dijit/form/Button','dojo/domReady!'], function(LazyTreeGrid,WriteStore,LazyModel,Button){ console.debug("Start of dojo ready."); var writeStoreObj = new WriteStore({data : data}); lazyTreeMdlObj = new LazyModel({store: writeStoreObj, childrenAttrs: ['children']}); layout = [ {name: 'Name', field: 'name', width: 'auto'}, {name: 'Type', field: 'type', width: 'auto'} ]; lzyTreeGrdObj = new LazyTreeGrid({ treeModel : lazyTreeMdlObj, structure : layout, keepSelection:'true', rowSelector:'true' },'guru'); lzyTreeGrdObj.startup(); Can any one plz go through the code and let me know if there are any issues in the code. Thank You Guru

View this message in context: Lazy tree grid editing issue
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
kornel | 24 Apr 01:24 2014

data-dojo-attach-event looking for handler in the wrong scope for templated widgets

I have encountered a problem while trying to use data-dojo-attach-event: 

1. I am trying to create a templated custom widget which has inside it a 
form Manager and a ValidationTextBox.

Template: templates/MyForm.html:

<div>
    <form data-dojo-type="custom/MyFancyFormManager"
          data-dojo-attach-point="form">
         <input type="text" style="width: 400px;" name="name"
                               data-dojo-type="dijit/form/ValidationTextBox"
                               data-dojo-attach-point="name"
                               data-dojo-attach-event="onChange:
myOnChange"/>
	...
    </form>
</div>

Custom widget javascript MyForm.js:

define([
    "dojo/_base/declare",
    "dijit/_WidgetBase",
    "dijit/_TemplatedMixin",
    'dijit/_WidgetsInTemplateMixin',
    "dojo/text!./templates/MyForm.html",
    "dijit/form/ValidationTextBox",
    "custom/MyFancyFormManager"
], function( declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin,
template ){

    return declare( [_WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin],
{
        templateString: template,

        myOnChange: function(e){
		alert('do some fancy validation');
        }
    });
});

The error I am getting:
dojo/parser::parse() error lang.hitch: scope["myOnChange"] is null
(scope="[Widget uniqName_2, uniqName_2_0]")
(That scope seems to point to the form MyFancyFormManager  and not the root
of the template)

2. The error goes away if I also put myOnChange function declaration into 
the MyFancyFormManager. When the onChange event occurs it actually calls it 
in the right place i.e. in my custom MyForm.js widget.

In other words, the parser seems to be looking in the wrong place: in the 
form and not in my widget. But the template actually attaches to the right
version of the event method, which is on my widget outside the template.

Am I doing something wrong?

--
View this message in context: http://dojo-toolkit.33424.n3.nabble.com/data-dojo-attach-event-looking-for-handler-in-the-wrong-scope-for-templated-widgets-tp4002050.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

Ken Benjamin | 23 Apr 20:36 2014
Picon

Re: Help with populating dojo combobox from JS

Shouldn't 

 var dstore = new ItemFileReadStore({ data: items }); 

be

 var dstore = new ItemFileReadStore( storeData2 ); 

?

akpaga wrote
> Hi friends,
> 
> I am having trouble populating my dojo combo box with the code below. Can
> some please guide me on this.
> The function cmbLayer some how does not poulate my box.
> Thank You
> 
> html code:customer.html
> <select data-dojo-type="dijit.form.ComboBox" name="Layers" 
> data-dojo-id="LayersCmbBox"  id="LayersCmbBox"
> data-dojo-attach-point="fsLayer"/>
> 
> js code:
> 
> define([
>     'dojo/_base/declare',
>     'dijit/_WidgetBase',
>     'dijit/_TemplatedMixin',
>     'dijit/_WidgetsInTemplateMixin',
>     "dijit/registry",
>     'dijit/form/Form',
>     'dijit/form/FilteringSelect',
>     'dijit/form/ValidationTextBox',
>     'dijit/form/Button',   
>     "dijit/layout/ContentPane",
>     "dojo/store/Memory",
>     "dojo/data/ItemFileReadStore",
>     'dojox/grid/DataGrid',
>     'dijit/TooltipDialog',
>     'esri/tasks/query',
>     'esri/tasks/QueryTask',
>     'esri/config',
>     'dojo/store/Memory',
>     'dojo/_base/lang',
>     'dojo/_base/array',
>     'dojo/text!./Search/templates/Search.html',
>     "dojo/parser",
>     'dijit/form/ComboBox',
>     "dijit/form/FilteringSelect",
>      "dojo/domReady!"
> 
> ], function (declare, _WidgetBase, _TemplatedMixin,
> _WidgetsInTemplateMixin, registry, Form, FilteringSelect,
> ValidationTextBox, Button, ContentPane, Memory, ItemFileReadStore,
> DataGrid, TooltipDialog, query, QueryTask, esriConfig, Memory, lang,
> array, searchTemplate, parser, ComboBox, FilteringSelect,dom) {
> 
> 	//anonymous function to load CSS files required for this module
> 	(function () {
> 		var css = [require.toUrl("gis/dijit/Search/css/Search.css")];
> 		var head = document.getElementsByTagName("head").item(0),
>             link;
> 		for (var i = 0, il = css.length; i < il; i++) {
> 			link = document.createElement("link");
> 			link.type = "text/css";
> 			link.rel = "stylesheet";
> 			link.href = css[i].toString();
> 			head.appendChild(link);
> 		}
> 		parser.parse();
> 	} ());
> 
> 	// Main search dijit
> 	var Search = declare([_WidgetBase, _TemplatedMixin,
> _WidgetsInTemplateMixin], 
>     {
> 		widgetsInTemplate: true,
> 		templateString: searchTemplate,
> 		map: null,
> 		defaultTitle: null,
> 		queryTask: null,
> 		query: null,
>         _store1: null,
>        _selectorOne: null,
>        postCreate: function () {
> 
>            self = this;
>            this.map = controller.map;
> 
> 			this.inherited(arguments);
> 			this.queryTask = new esri.tasks.QueryTask(this.queryTaskURL);
> 			this.query = new esri.tasks.Query();
> 			this.query.outSpatialReference = this.map.spatialReference;
> 			this.query.returnGeometry = true;
> 			this.query.outFields = ["id", "ASTName", "URSStatus"];
> 			self.cmbLayer();
> 		},
> 
> 		cmbLayer: function () {
> 		    var storeData2 = {
> 		        identifier: 'abbr',
> 		        label: 'name',
> 		        items: [
>                   { abbr: 'ec', name: 'Ecuador', capital: 'Quito' },
>                   { abbr: 'eg', name: 'Egypt', capital: 'Cairo' },
>                   { abbr: 'sv', name: 'El Salvador', capital: 'San
> Salvador' },
>                   { abbr: 'gq', name: 'Equatorial Guinea', capital:
> 'Malabo' },
>                   { abbr: 'er', name: 'Eritrea', capital: 'Asmara' },
>                   { abbr: 'ee', name: 'Estonia', capital: 'Tallinn' },
>                   { abbr: 'et', name: 'Ethiopia', capital: 'Addis Ababa' }
> 		        ]
> 		    };
> 
> 
> 		    var dstore = new ItemFileReadStore({ data: items });
> 
> 		    var cmbLayers = registry.byId("fsLayer");
> 		    cmbLayers.setStore(dstore);
> 
> 
> 
>     },
> 		 
> 
> 		search: function() {
>                    
> 			
> 
> 			}),
>             
>                 function (err) {
> 				    console.log(err);
> 			    });
> 		}
> 	});
> 	return Search;
> });

-----
Kenneth Benjamin

Happiness International  Want to discover your ideal path to happiness? Get our free Happiness Toolkit to
find yours. 
P.S. Our Happiness Planner&trade; is powered by the Dojo Toolkit 

--
View this message in context: http://dojo-toolkit.33424.n3.nabble.com/Help-with-populating-dojo-combobox-from-JS-tp4002043p4002048.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

Ken Benjamin | 23 Apr 20:30 2014
Picon

Re: Dojo Conatiner, Iframe and jsession

IFrames are just like separate windows and have their own local context, thus
separate loads of dojo.

If you want to truly merge them together, you would have to rewrite the apps
to be contained inside the tab container rather than as separate apps. That
might be easy - see dojox/layout/contentpane if you need to run scripts in
the contentpane. Or it might be hard if there are conflicts in the code.

You have to decide if it's worth the trouble. If the apps are built and your
users are connecting over a slow link or mobile, then it might be
worthwhile. If they aren't built then browser caching will take care of any
duplicate loading so it doesn't matter if you load dojo.js 100 times, it
still only gets it from the server once. If your users are on a fast link
then it also probably doesn't matter.

It's a question of cost/benefit. As for what's traditional, it depends. If
it's a portal type app you're building, then iframes are typical. If the
parts are intended to always work together and are interdependent or
interact, then merging them into the same window context is the best way but
not the only way.

KellyFKerr wrote
> I have 2 existing web applications that I want to present in individual
> tabs within a 3rd (new) web application and make it look like all the same
> application. Each existing application has unique session data. I have
> been able to accomplish this using an HTML Iframe tag within a dojo tab
> containers. The issue is that each application seems to load dojo
> separately. Is this the proper technique for mashing together 2
> applications and how can I share the dojo loading between all
> applications? Thanks

-----
Kenneth Benjamin

Happiness International  Want to discover your ideal path to happiness? Get our free Happiness Toolkit to
find yours. 
P.S. Our Happiness Planner&trade; is powered by the Dojo Toolkit 

--
View this message in context: http://dojo-toolkit.33424.n3.nabble.com/Dojo-Conatiner-Iframe-and-jsession-tp4002036p4002047.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

Ken Benjamin | 23 Apr 20:17 2014
Picon

Re: Different Tab with Same JSP. Variable conflict

It's hard to tell what your conflicts are but I'm guessing it's that you have
duplicate ID's and that won't work. You can create the contentpane without
specifying the ID and dijit/registry will assign a unique one automatically
(which you can find after it is created i.e. tab.id property.

If there is other code in your jsp then you should wrap that code inside a
closure instead of creating global variables. 

utkarsh144 wrote
> Hi, I am creating dynamic tab using the below below script and content of
> the tab will contain same jsp or different jsp depend of the selection.
> Now whenever i have same jsp, its open fine first tab but in 2nd tab due
> to confliting variable in the jsp page (as its same jsp loaded in same tab
> container), creating problem and page not render properly. Is there any
> way i can specify the scope where each tab behave indepdently without
> confliting variables of other tab?
> 
> function addTab(name, url) {
> 		
> 		
> 		name = name.replace(/#/g, ' ');
>         var myTabContainer = dijit.byId("tabContainer"),
>                         tempid = "contentTab_tablist_"+name,
>                         tab = dijit.byId(tempid);
>                        
>         if(tab) {
>                  myTabContainer.selectChild(tab);
>         } else {
>                 targetUrl = url;        
>                 tab = new dojox.layout.ContentPane({
>                                 id:tempid,
>                                 title: name,
>                                 closable :true,
>                                 href:targetUrl
>                                                             
>                 });
>                 myTabContainer.addChild(tab);
>                 myTabContainer.selectChild(tab);               
>                 myTabContainer.startup();
>         }

-----
Kenneth Benjamin

Happiness International  Want to discover your ideal path to happiness? Get our free Happiness Toolkit to
find yours. 
P.S. Our Happiness Planner&trade; is powered by the Dojo Toolkit 

--
View this message in context: http://dojo-toolkit.33424.n3.nabble.com/Different-Tab-with-Same-JSP-Variable-conflict-tp4002033p4002046.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

Ken Benjamin | 23 Apr 20:09 2014
Picon

Re: Screen Configuration based on roles

There are many ways to do this but a simple way might be to use dojo/query to
select and set the correct css and html properties on the various fields.

Keep in mind that hiding something or disabling input in the client is
offers no security whatsoever. It's just for visual purposes. You'll still
have to validate input on the server side.

-----
Kenneth Benjamin

Happiness International  Want to discover your ideal path to happiness? Get our free Happiness Toolkit to
find yours. 
P.S. Our Happiness Planner&trade; is powered by the Dojo Toolkit 

--
View this message in context: http://dojo-toolkit.33424.n3.nabble.com/Screen-Configuration-based-on-roles-tp4002028p4002045.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

Ungerer, Jens | 23 Apr 18:05 2014

dGrid - Selecting (Filtering) items / complex criteria (e.g. age > 25)

I am using dGrid with the tree plugin.
It is possible pass a query to the TreeGrid with treeGrid.set("query", {id: 5}) cf[1].

I've tried to use complex criteria like age > 25 cf[2].
I've passed a function with the same syntax.
This results in [object Error] _StoreMixin.js:28.
Can you please give me a example how to pass a function.

Is there another approach to use complex criteria in a TreeGrid?

regards
Jens

[1] http://dojofoundation.org/packages/dgrid/tutorials/grids_and_stores/
[2] http://www.sitepen.com/blog/2013/10/09/dojo-faq-how-can-i-query-a-store-for-values-greater-than-or-less-than-another-value-or-some-other-complex-query/
--

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

workaholic2014 | 23 Apr 17:06 2014
Picon

Getting started with Dojo - Custom Analog Gauges

Hello,

I have a client interested in using the top left gauge on the custom analog
gauges page: http://demos.dojotoolkit.org/demos/gauges/demo.html

I'm not sure where to start, and I'd like to know if there's a quick
tutorial or sample specified to this gauge that I can use. 

The demo shows me the final product, but I'm looking for the source that
built it.. any help would be appreciated, as i don't have a lot of time to
figure out if i can incorporate this into my application.

Thanks,

Earl

--
View this message in context: http://dojo-toolkit.33424.n3.nabble.com/Getting-started-with-Dojo-Custom-Analog-Gauges-tp4002041.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

Dazza | 23 Apr 00:57 2014
Picon

Dgrid rows disappear when sorting

I've implemented the dgrid. It's really neat. However when I click on the row
header to sort, all but one row disappears. I'm going nuts trying to figure
out why....

Let's give this a go.

DGrid, it's a dojo based data grid, see
http://dojofoundation.org/packages/dgrid/

When using this with Javascript and HTML and connecting to an Observable
MemStore, the grid populates, with several rows quite happily displaying
data. The columns are sortable, that is you can click on the the row/column
heading. However - and here's the problem - when clicking on these
row/column headers to sort the row's, all but one row disappears.

Using a Memory (dojo/store/Memory) a the dGrids data store work fine - ie
the rows sort successfully. However when using the Observable
(dojo/store/Observable) as a data store the sort causes the rows to
collapse. Please see below examples.

Sort working great with Memory:

function populateGrid(Memory, message) {
               var featureOne = {
                      "Col1": message[0].attributes["Col1"],
                      "Col2": message[0].attributes["Col2"],
                      "Col3": message[0].attributes["Col3"]
                  }
                var featureTwo = {
                      "Col1": message[1].attributes["Col1"],
                      "Col2": message[1].attributes["Col2"],
                      "Col3": message[1].attributes["Col3"]
                  }

                  var data = [feature1, feature2];
                  var memStore = new Memory({ data: data });
                  window.queryRecordsGrid.set("store", memStore);
              }
The error occurs when using Observable:

 var memStore;

 function populateGrid(Memory, message) {
                   var feature = {
                          "Col1": message[0].attributes["Col1"],
                          "Col2": message[0].attributes["Col2"],
                          "Col3": message[0].attributes["Col3"]
                      }

                     var data = [feature];
                     if (!window.memStore) {
                  window.memStore = new Observable(new Memory({ data: data
}));
                  window.grid.set("store", window.memStore);

              } else {

                  window.grid.store.notify(feature, feature.id);

              }
                  }

--
View this message in context: http://dojo-toolkit.33424.n3.nabble.com/Dgrid-rows-disappear-when-sorting-tp4002038.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

thebasa | 22 Apr 21:40 2014

Attach event to future elements injected into page

What's the preferred way to bind to elements that may not yet exist on a page
(e.g. html to be injected later from ajax call)? 

jquery on() handles this by attaching to document and includes a second
filtering param:

$(document).on('click','.table-responsive tbody tr',function(e){
  // future responsive table row click
}); 

just wondering if there are plans to have dojo on() do this same thing
because I thought on() was the preferred newer evented deal.

--
View this message in context: http://dojo-toolkit.33424.n3.nabble.com/Attach-event-to-future-elements-injected-into-page-tp4002035.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

Gouthami | 22 Apr 14:38 2014
Picon

Dojo Grid - Disabled a row or greying out a row

hi,

I am working currently on gridx and i need to grey out a row and disable it.

The grid has cells which have numeric data,character data and few cells has
images along with numeric data and few cells have text boxes to edit the
data.

So based on a column in a row the remaining columns of that row should get
greyed out and disabled(so that no action is performed on images(like hover)
and shouldn't be able to edit text box.)

I tried doing this using formatter and decorator of each column of the row.I
tried to get the value  of decision column and appended the value to actual
value of column in formatter and returned to decorator where i have
modified the style of the tag ,sliced the appended value and displayed on
the grid.

By doing this everything works fine,except the filter functionality.

Now since i have appended values for few rows filter works along with
appended value even though i sliced it in decorator.

Below is example.

Col1   Col2

I        123

null    234

I       345

in formatter of col2 im returning as I123,234,I345 and in decorator i slice
and send to UI back as 123,234,345.

But i cant filter using col2 equals 123 but gets filtered if condition is
I123.

I guess the filter is taking the data from formatter.Can someone help me in
doing this?

--
View this message in context: http://dojo-toolkit.33424.n3.nabble.com/Dojo-Grid-Disabled-a-row-or-greying-out-a-row-tp4002032.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