Login Register

constructor

Problems overriding constructor when extending SortedList

I'm trying to extend dojox.collections.SortedList to allow an ascending or descending sort order based on a boolean passed into the constructor. This is my first go at extending a widget, so I'm hitting a few life cycle problems.

My code is :


// SortedList supporting ascending and descending sort
dojo.provide("gwp.SortedListTwoWay");
dojo.require("dojox.collections._base");
dojo.declare("gwp.SortedListTwoWay", dojox.collections.SortedList, {
sortAsc: true,
constructor: function(/*object*/dictionary, /*boolean*/ sortAscending)
{
this.inherited([dictionary]);

When do I need to use a constructor function in my widget?

when do I need to use a constructor function in my widget? it doesn't seem like I ever need one? Any member variables passed in seem to be automatically set and accessible in postMixInProperties.

dojo 1.0.2: dojo.data.ItemFileReadStore not accepting data keyword in constructor?

I am testing out an upgrade to dojo 1.0.2 and I ran into a problem using loaded JSON data to instantiate an item store. I found a thread online that shows the same problem but no answer:

http://www.nabble.com/data-store-td14248070.html

The code example given apparently worked for one person but, like myself, not for the person using 1.0.2:


dojo.require('dojo.data.ItemFileReadStore');
var data = {data: {
identifier : 'id',
items : [
{ id : 'a', label: "Letter A" },
{ id : 'b', label: "Letter B" },

Syndicate content