error loading root children

View: New views
12 Messages — Rating Filter:   Alert me  

error loading root children

by gederer :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I use the JSON below to create an ItemFileReadStore, which I then use to
create a ForestStoreModel, which I use to create a Tree.  When I leave
out the 'months' property in the item with 'name' : 'RFE', it works
perfectly.  But, when 'months' refers to an {}, I get the following error:

 [Widget dijit.Tree, dijit_Tree_0] _connects=HTMLDivElement
_deferredConnects=Object : error loading root children:  TypeError: _48
is undefined message=_48 is undefined

I've tried using:

{
    'name' : 'RFE',
    'type' : 'dataset',
    'periodicities' : [ 'daily', 'dekadal', 'monthly' ],
    'selectedPeriodicity' : 'monthly',
    'units' : [ 'raw', 'percent', 'zscore', 'mmdifference', 'spi' ],
    'selectedUnits' : 'raw',
    'months' : {}
  }

as a test, and this doesn't work, either.  Is it permissible to have a
nested object in an item?

Here's the complete JSON:

{
  identifier : 'name',
  label : 'name',
  items : [
  {
    'name' : 'All Africa',
    'type' : 'region',
    'children': [
    {
      '_reference' : 'RFE'
    },
    {
      '_reference' : 'TPW'
    },
    {
      '_reference' : 'NDVI'
    },
    {
      '_reference' : 'WRSI'
    }
    ]
  },
  {
    'name' : 'East Africa',
    'type' : 'region',
    'children': [
    {
      '_reference' : 'RFE'
    },
    {
      '_reference' : 'TPW'
    },
    {
      '_reference' : 'NDVI'
    },
    {
      '_reference' : 'WRSI'
    }
    ]
  },
  {
    'name' : 'West Africa',
    'type' : 'region',
    'children': [
    {
      '_reference' : 'RFE'
    },
    {
      '_reference' : 'TPW'
    },
    {
      '_reference' : 'NDVI'
    },
    {
      '_reference' : 'WRSI'
    }
    ]
  },
  {
    'name' : 'South Africa',
    'type' : 'region',
    'children': [
    {
      '_reference' : 'RFE'
    },
    {
      '_reference' : 'TPW'
    },
    {
      '_reference' : 'NDVI'
    },
    {
      '_reference' : 'WRSI'
    }
    ]
  },
  {
    'name' : 'RFE',
    'type' : 'dataset',
    'periodicities' : [ 'daily', 'dekadal', 'monthly' ],
    'selectedPeriodicity' : 'monthly',
    'units' : [ 'raw', 'percent', 'zscore', 'mmdifference', 'spi' ],
    'selectedUnits' : 'raw',
    'months' : {
      '2003' : 'all',
      '2004' : 'all',
      '2005' : 'all',
      '2006' : 'all',
      '2007' : 'all',
      '2008' : [ '1', '2', '3', '4', '5', '6', '7' ]
    }
  },
  {
    'name' : 'TPW',
    'type' : 'dataset',
    'periodicities' : [ 'daily', 'dekadal' ],
    'selectedPeriodicity' : 'dekadal',
    'units' : [ 'raw', 'percent' ],
    'selectedUnits' : 'percent'
  },
  {
    'name' : 'NDVI',
    'type' : 'dataset',
    'periodicities' : [ 'daily', 'monthly' ],
    'selectedPeriodicity' : 'daily',
    'units' : [ 'raw', 'percent', 'spi' ],
    'selectedUnits' : 'spi'
  },
  {
    'name' : 'WRSI',
    'type' : 'dataset',
    'periodicities' : [ 'dekadal', 'monthly' ],
    'units' : [ 'raw', 'percent', 'zscore', 'spi' ],
    'selectedUnits' : 'zscore'
  }
  ]
}

Any thoughts?

Thanks!

Greg

--
| E R G O N O S I S
| Greg Ederer
| Lead Developer
| greg@...
| 360.774.6848
|

_______________________________________________
FAQ: http://dojotoolkit.org/support/faq
Book: http://dojotoolkit.org/docs/book
Forums: http://dojotoolkit.org/forum
Dojo-interest@...
http://turtle.dojotoolkit.org/mailman/listinfo/dojo-interest

Réponse en cas d'absence

by rital77 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

    Heya,how are you doing recently ? I would like to introduce you a very good company which i knew.Their website is  www.trailblazer917.com   .They can offer you all kinds of electronical products which you need like laptops ,gps ,TV LCD,cell phones,ps3,MP3/4,motorcycles  etc........Please take some time to have a check ,there must be somethings you 'd like to purchase .
Their contact email:
trailblazer.817@...
.  MSN: trailblazer.916@...TEL:  0086+135 2231 7720
Hope you have a good mood in shopping from their company !
Regards

_______________________________________________
FAQ: http://dojotoolkit.org/support/faq
Book: http://dojotoolkit.org/docs/book
Forums: http://dojotoolkit.org/forum
Dojo-interest@...
http://turtle.dojotoolkit.org/mailman/listinfo/dojo-interest

Re: error loading root children

by jaredj :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

A nested object in an item is treated as another item.  See:
http://docs.dojocampus.org/dojo/data/ItemFileReadStore#items-with-hierarchy.
 In this case, you declare the identifier, then have an item that
doesn't have an identifier.  The load of that structure will fail in
the store.

-- Jared

On Sun, Oct 5, 2008 at 4:12 PM, Greg Ederer <greg@...> wrote:

> Hi,
>
> I use the JSON below to create an ItemFileReadStore, which I then use to
> create a ForestStoreModel, which I use to create a Tree.  When I leave
> out the 'months' property in the item with 'name' : 'RFE', it works
> perfectly.  But, when 'months' refers to an {}, I get the following error:
>
>  [Widget dijit.Tree, dijit_Tree_0] _connects=HTMLDivElement
> _deferredConnects=Object : error loading root children:  TypeError: _48
> is undefined message=_48 is undefined
>
> I've tried using:
>
> {
>    'name' : 'RFE',
>    'type' : 'dataset',
>    'periodicities' : [ 'daily', 'dekadal', 'monthly' ],
>    'selectedPeriodicity' : 'monthly',
>    'units' : [ 'raw', 'percent', 'zscore', 'mmdifference', 'spi' ],
>    'selectedUnits' : 'raw',
>    'months' : {}
>  }
>
> as a test, and this doesn't work, either.  Is it permissible to have a
> nested object in an item?
>
> Here's the complete JSON:
>
> {
>  identifier : 'name',
>  label : 'name',
>  items : [
>  {
>    'name' : 'All Africa',
>    'type' : 'region',
>    'children': [
>    {
>      '_reference' : 'RFE'
>    },
>    {
>      '_reference' : 'TPW'
>    },
>    {
>      '_reference' : 'NDVI'
>    },
>    {
>      '_reference' : 'WRSI'
>    }
>    ]
>  },
>  {
>    'name' : 'East Africa',
>    'type' : 'region',
>    'children': [
>    {
>      '_reference' : 'RFE'
>    },
>    {
>      '_reference' : 'TPW'
>    },
>    {
>      '_reference' : 'NDVI'
>    },
>    {
>      '_reference' : 'WRSI'
>    }
>    ]
>  },
>  {
>    'name' : 'West Africa',
>    'type' : 'region',
>    'children': [
>    {
>      '_reference' : 'RFE'
>    },
>    {
>      '_reference' : 'TPW'
>    },
>    {
>      '_reference' : 'NDVI'
>    },
>    {
>      '_reference' : 'WRSI'
>    }
>    ]
>  },
>  {
>    'name' : 'South Africa',
>    'type' : 'region',
>    'children': [
>    {
>      '_reference' : 'RFE'
>    },
>    {
>      '_reference' : 'TPW'
>    },
>    {
>      '_reference' : 'NDVI'
>    },
>    {
>      '_reference' : 'WRSI'
>    }
>    ]
>  },
>  {
>    'name' : 'RFE',
>    'type' : 'dataset',
>    'periodicities' : [ 'daily', 'dekadal', 'monthly' ],
>    'selectedPeriodicity' : 'monthly',
>    'units' : [ 'raw', 'percent', 'zscore', 'mmdifference', 'spi' ],
>    'selectedUnits' : 'raw',
>    'months' : {
>      '2003' : 'all',
>      '2004' : 'all',
>      '2005' : 'all',
>      '2006' : 'all',
>      '2007' : 'all',
>      '2008' : [ '1', '2', '3', '4', '5', '6', '7' ]
>    }
>  },
>  {
>    'name' : 'TPW',
>    'type' : 'dataset',
>    'periodicities' : [ 'daily', 'dekadal' ],
>    'selectedPeriodicity' : 'dekadal',
>    'units' : [ 'raw', 'percent' ],
>    'selectedUnits' : 'percent'
>  },
>  {
>    'name' : 'NDVI',
>    'type' : 'dataset',
>    'periodicities' : [ 'daily', 'monthly' ],
>    'selectedPeriodicity' : 'daily',
>    'units' : [ 'raw', 'percent', 'spi' ],
>    'selectedUnits' : 'spi'
>  },
>  {
>    'name' : 'WRSI',
>    'type' : 'dataset',
>    'periodicities' : [ 'dekadal', 'monthly' ],
>    'units' : [ 'raw', 'percent', 'zscore', 'spi' ],
>    'selectedUnits' : 'zscore'
>  }
>  ]
> }
>
> Any thoughts?
>
> Thanks!
>
> Greg
>
> --
> | E R G O N O S I S
> | Greg Ederer
> | Lead Developer
> | greg@...
> | 360.774.6848
> |
>
> _______________________________________________
> FAQ: http://dojotoolkit.org/support/faq
> Book: http://dojotoolkit.org/docs/book
> Forums: http://dojotoolkit.org/forum
> Dojo-interest@...
> http://turtle.dojotoolkit.org/mailman/listinfo/dojo-interest
>
_______________________________________________
FAQ: http://dojotoolkit.org/support/faq
Book: http://dojotoolkit.org/docs/book
Forums: http://dojotoolkit.org/forum
Dojo-interest@...
http://turtle.dojotoolkit.org/mailman/listinfo/dojo-interest

Réponse en cas d'absence

by rital77 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

    Heya,how are you doing recently ? I would like to introduce you a very good company which i knew.Their website is  www.trailblazer917.com   .They can offer you all kinds of electronical products which you need like laptops ,gps ,TV LCD,cell phones,ps3,MP3/4,motorcycles  etc........Please take some time to have a check ,there must be somethings you 'd like to purchase .
Their contact email:
trailblazer.817@...
.  MSN: trailblazer.916@...TEL:  0086+135 2231 7720
Hope you have a good mood in shopping from their company !
Regards

_______________________________________________
FAQ: http://dojotoolkit.org/support/faq
Book: http://dojotoolkit.org/docs/book
Forums: http://dojotoolkit.org/forum
Dojo-interest@...
http://turtle.dojotoolkit.org/mailman/listinfo/dojo-interest

Re: Réponse en cas d'absence

by Peter E Higgins-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

ugh. sorry everyone -

rital77@... wrote:

> *    Heya,how are you doing recently ? I would like to introduce you a
> very good company which i knew.Their website is
> **_www.trailblazer917.com_* <http://www.trailblazer917.com/>*   .They
> can offer you all kinds of electronical products which you need like
> laptops ,gps ,TV LCD,cell phones,ps3,MP3/4,motorcycles
> etc........Please take some time to have a check ,there must be
> somethings you 'd like to purchase .
> Their contact email: **_trailblazer.817@...*
> <mailto:trailblazer.817@...>*.  MSN:
> **_trailblazer.916@...
> _* <mailto:trailblazer.916@...>*TEL:  0086+135 2231 7720
> Hope you have a good mood in shopping from their company !
> Regards*
> ------------------------------------------------------------------------
>
> _______________________________________________
> FAQ: http://dojotoolkit.org/support/faq
> Book: http://dojotoolkit.org/docs/book
> Forums: http://dojotoolkit.org/forum
> Dojo-interest@...
> http://turtle.dojotoolkit.org/mailman/listinfo/dojo-interest
>  

_______________________________________________
FAQ: http://dojotoolkit.org/support/faq
Book: http://dojotoolkit.org/docs/book
Forums: http://dojotoolkit.org/forum
Dojo-interest@...
http://turtle.dojotoolkit.org/mailman/listinfo/dojo-interest

Réponse en cas d'absence

by rital77 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

    Heya,how are you doing recently ? I would like to introduce you a very good company which i knew.Their website is  www.trailblazer917.com   .They can offer you all kinds of electronical products which you need like laptops ,gps ,TV LCD,cell phones,ps3,MP3/4,motorcycles  etc........Please take some time to have a check ,there must be somethings you 'd like to purchase .
Their contact email:
trailblazer.817@...
.  MSN: trailblazer.916@...TEL:  0086+135 2231 7720
Hope you have a good mood in shopping from their company !
Regards

_______________________________________________
FAQ: http://dojotoolkit.org/support/faq
Book: http://dojotoolkit.org/docs/book
Forums: http://dojotoolkit.org/forum
Dojo-interest@...
http://turtle.dojotoolkit.org/mailman/listinfo/dojo-interest

Re: error loading root children

by David Worms :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


With the ItemFileReadStore, you can explorer this type of construct:

my_date: {"_type":"Date","_value":"2037-06-30"}

instead of

my_date: "2037-06-30"

I might be wrong, but it should work with objects as well as long as you
define the type handler (Date here) but it is currently not supported by
all store, ItemFileReadStore does.

Another alternative (not very cute), is to encode the object to json
such as it become a string and decode it when you retrieve the value
from the store.

d.


Jared Jurkiewicz a écrit :

> A nested object in an item is treated as another item.  See:
> http://docs.dojocampus.org/dojo/data/ItemFileReadStore#items-with-hierarchy.
>  In this case, you declare the identifier, then have an item that
> doesn't have an identifier.  The load of that structure will fail in
> the store.
>
> -- Jared
>
> On Sun, Oct 5, 2008 at 4:12 PM, Greg Ederer <greg@...> wrote:
>  
>> Hi,
>>
>> I use the JSON below to create an ItemFileReadStore, which I then use to
>> create a ForestStoreModel, which I use to create a Tree.  When I leave
>> out the 'months' property in the item with 'name' : 'RFE', it works
>> perfectly.  But, when 'months' refers to an {}, I get the following error:
>>
>>  [Widget dijit.Tree, dijit_Tree_0] _connects=HTMLDivElement
>> _deferredConnects=Object : error loading root children:  TypeError: _48
>> is undefined message=_48 is undefined
>>
>> I've tried using:
>>
>> {
>>    'name' : 'RFE',
>>    'type' : 'dataset',
>>    'periodicities' : [ 'daily', 'dekadal', 'monthly' ],
>>    'selectedPeriodicity' : 'monthly',
>>    'units' : [ 'raw', 'percent', 'zscore', 'mmdifference', 'spi' ],
>>    'selectedUnits' : 'raw',
>>    'months' : {}
>>  }
>>
>> as a test, and this doesn't work, either.  Is it permissible to have a
>> nested object in an item?
>>
>> Here's the complete JSON:
>>
>> {
>>  identifier : 'name',
>>  label : 'name',
>>  items : [
>>  {
>>    'name' : 'All Africa',
>>    'type' : 'region',
>>    'children': [
>>    {
>>      '_reference' : 'RFE'
>>    },
>>    {
>>      '_reference' : 'TPW'
>>    },
>>    {
>>      '_reference' : 'NDVI'
>>    },
>>    {
>>      '_reference' : 'WRSI'
>>    }
>>    ]
>>  },
>>  {
>>    'name' : 'East Africa',
>>    'type' : 'region',
>>    'children': [
>>    {
>>      '_reference' : 'RFE'
>>    },
>>    {
>>      '_reference' : 'TPW'
>>    },
>>    {
>>      '_reference' : 'NDVI'
>>    },
>>    {
>>      '_reference' : 'WRSI'
>>    }
>>    ]
>>  },
>>  {
>>    'name' : 'West Africa',
>>    'type' : 'region',
>>    'children': [
>>    {
>>      '_reference' : 'RFE'
>>    },
>>    {
>>      '_reference' : 'TPW'
>>    },
>>    {
>>      '_reference' : 'NDVI'
>>    },
>>    {
>>      '_reference' : 'WRSI'
>>    }
>>    ]
>>  },
>>  {
>>    'name' : 'South Africa',
>>    'type' : 'region',
>>    'children': [
>>    {
>>      '_reference' : 'RFE'
>>    },
>>    {
>>      '_reference' : 'TPW'
>>    },
>>    {
>>      '_reference' : 'NDVI'
>>    },
>>    {
>>      '_reference' : 'WRSI'
>>    }
>>    ]
>>  },
>>  {
>>    'name' : 'RFE',
>>    'type' : 'dataset',
>>    'periodicities' : [ 'daily', 'dekadal', 'monthly' ],
>>    'selectedPeriodicity' : 'monthly',
>>    'units' : [ 'raw', 'percent', 'zscore', 'mmdifference', 'spi' ],
>>    'selectedUnits' : 'raw',
>>    'months' : {
>>      '2003' : 'all',
>>      '2004' : 'all',
>>      '2005' : 'all',
>>      '2006' : 'all',
>>      '2007' : 'all',
>>      '2008' : [ '1', '2', '3', '4', '5', '6', '7' ]
>>    }
>>  },
>>  {
>>    'name' : 'TPW',
>>    'type' : 'dataset',
>>    'periodicities' : [ 'daily', 'dekadal' ],
>>    'selectedPeriodicity' : 'dekadal',
>>    'units' : [ 'raw', 'percent' ],
>>    'selectedUnits' : 'percent'
>>  },
>>  {
>>    'name' : 'NDVI',
>>    'type' : 'dataset',
>>    'periodicities' : [ 'daily', 'monthly' ],
>>    'selectedPeriodicity' : 'daily',
>>    'units' : [ 'raw', 'percent', 'spi' ],
>>    'selectedUnits' : 'spi'
>>  },
>>  {
>>    'name' : 'WRSI',
>>    'type' : 'dataset',
>>    'periodicities' : [ 'dekadal', 'monthly' ],
>>    'units' : [ 'raw', 'percent', 'zscore', 'spi' ],
>>    'selectedUnits' : 'zscore'
>>  }
>>  ]
>> }
>>
>> Any thoughts?
>>
>> Thanks!
>>
>> Greg
>>
>> --
>> | E R G O N O S I S
>> | Greg Ederer
>> | Lead Developer
>> | greg@...
>> | 360.774.6848
>> |
>>
>> _______________________________________________
>> FAQ: http://dojotoolkit.org/support/faq
>> Book: http://dojotoolkit.org/docs/book
>> Forums: http://dojotoolkit.org/forum
>> Dojo-interest@...
>> http://turtle.dojotoolkit.org/mailman/listinfo/dojo-interest
>>
>>    
> _______________________________________________
> FAQ: http://dojotoolkit.org/support/faq
> Book: http://dojotoolkit.org/docs/book
> Forums: http://dojotoolkit.org/forum
> Dojo-interest@...
> http://turtle.dojotoolkit.org/mailman/listinfo/dojo-interest
>  


_______________________________________________
FAQ: http://dojotoolkit.org/support/faq
Book: http://dojotoolkit.org/docs/book
Forums: http://dojotoolkit.org/forum
Dojo-interest@...
http://turtle.dojotoolkit.org/mailman/listinfo/dojo-interest

Re: error loading root children

by jaredj :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Yes, ItemFile*Store has the option of defining a custom data type as
well, which will keep the store from treating nested objects of a
specific form as a datastore item:

http://docs.dojocampus.org/dojo/data/ItemFileReadStore#custom-types

-- Jared

On Mon, Oct 6, 2008 at 6:39 AM, Adaltas <ref@...> wrote:

>
> With the ItemFileReadStore, you can explorer this type of construct:
>
> my_date: {"_type":"Date","_value":"2037-06-30"}
>
> instead of
>
> my_date: "2037-06-30"
>
> I might be wrong, but it should work with objects as well as long as you
> define the type handler (Date here) but it is currently not supported by
> all store, ItemFileReadStore does.
>
> Another alternative (not very cute), is to encode the object to json
> such as it become a string and decode it when you retrieve the value
> from the store.
>
> d.
>
>
> Jared Jurkiewicz a écrit :
>> A nested object in an item is treated as another item.  See:
>> http://docs.dojocampus.org/dojo/data/ItemFileReadStore#items-with-hierarchy.
>>  In this case, you declare the identifier, then have an item that
>> doesn't have an identifier.  The load of that structure will fail in
>> the store.
>>
>> -- Jared
>>
>> On Sun, Oct 5, 2008 at 4:12 PM, Greg Ederer <greg@...> wrote:
>>
>>> Hi,
>>>
>>> I use the JSON below to create an ItemFileReadStore, which I then use to
>>> create a ForestStoreModel, which I use to create a Tree.  When I leave
>>> out the 'months' property in the item with 'name' : 'RFE', it works
>>> perfectly.  But, when 'months' refers to an {}, I get the following error:
>>>
>>>  [Widget dijit.Tree, dijit_Tree_0] _connects=HTMLDivElement
>>> _deferredConnects=Object : error loading root children:  TypeError: _48
>>> is undefined message=_48 is undefined
>>>
>>> I've tried using:
>>>
>>> {
>>>    'name' : 'RFE',
>>>    'type' : 'dataset',
>>>    'periodicities' : [ 'daily', 'dekadal', 'monthly' ],
>>>    'selectedPeriodicity' : 'monthly',
>>>    'units' : [ 'raw', 'percent', 'zscore', 'mmdifference', 'spi' ],
>>>    'selectedUnits' : 'raw',
>>>    'months' : {}
>>>  }
>>>
>>> as a test, and this doesn't work, either.  Is it permissible to have a
>>> nested object in an item?
>>>
>>> Here's the complete JSON:
>>>
>>> {
>>>  identifier : 'name',
>>>  label : 'name',
>>>  items : [
>>>  {
>>>    'name' : 'All Africa',
>>>    'type' : 'region',
>>>    'children': [
>>>    {
>>>      '_reference' : 'RFE'
>>>    },
>>>    {
>>>      '_reference' : 'TPW'
>>>    },
>>>    {
>>>      '_reference' : 'NDVI'
>>>    },
>>>    {
>>>      '_reference' : 'WRSI'
>>>    }
>>>    ]
>>>  },
>>>  {
>>>    'name' : 'East Africa',
>>>    'type' : 'region',
>>>    'children': [
>>>    {
>>>      '_reference' : 'RFE'
>>>    },
>>>    {
>>>      '_reference' : 'TPW'
>>>    },
>>>    {
>>>      '_reference' : 'NDVI'
>>>    },
>>>    {
>>>      '_reference' : 'WRSI'
>>>    }
>>>    ]
>>>  },
>>>  {
>>>    'name' : 'West Africa',
>>>    'type' : 'region',
>>>    'children': [
>>>    {
>>>      '_reference' : 'RFE'
>>>    },
>>>    {
>>>      '_reference' : 'TPW'
>>>    },
>>>    {
>>>      '_reference' : 'NDVI'
>>>    },
>>>    {
>>>      '_reference' : 'WRSI'
>>>    }
>>>    ]
>>>  },
>>>  {
>>>    'name' : 'South Africa',
>>>    'type' : 'region',
>>>    'children': [
>>>    {
>>>      '_reference' : 'RFE'
>>>    },
>>>    {
>>>      '_reference' : 'TPW'
>>>    },
>>>    {
>>>      '_reference' : 'NDVI'
>>>    },
>>>    {
>>>      '_reference' : 'WRSI'
>>>    }
>>>    ]
>>>  },
>>>  {
>>>    'name' : 'RFE',
>>>    'type' : 'dataset',
>>>    'periodicities' : [ 'daily', 'dekadal', 'monthly' ],
>>>    'selectedPeriodicity' : 'monthly',
>>>    'units' : [ 'raw', 'percent', 'zscore', 'mmdifference', 'spi' ],
>>>    'selectedUnits' : 'raw',
>>>    'months' : {
>>>      '2003' : 'all',
>>>      '2004' : 'all',
>>>      '2005' : 'all',
>>>      '2006' : 'all',
>>>      '2007' : 'all',
>>>      '2008' : [ '1', '2', '3', '4', '5', '6', '7' ]
>>>    }
>>>  },
>>>  {
>>>    'name' : 'TPW',
>>>    'type' : 'dataset',
>>>    'periodicities' : [ 'daily', 'dekadal' ],
>>>    'selectedPeriodicity' : 'dekadal',
>>>    'units' : [ 'raw', 'percent' ],
>>>    'selectedUnits' : 'percent'
>>>  },
>>>  {
>>>    'name' : 'NDVI',
>>>    'type' : 'dataset',
>>>    'periodicities' : [ 'daily', 'monthly' ],
>>>    'selectedPeriodicity' : 'daily',
>>>    'units' : [ 'raw', 'percent', 'spi' ],
>>>    'selectedUnits' : 'spi'
>>>  },
>>>  {
>>>    'name' : 'WRSI',
>>>    'type' : 'dataset',
>>>    'periodicities' : [ 'dekadal', 'monthly' ],
>>>    'units' : [ 'raw', 'percent', 'zscore', 'spi' ],
>>>    'selectedUnits' : 'zscore'
>>>  }
>>>  ]
>>> }
>>>
>>> Any thoughts?
>>>
>>> Thanks!
>>>
>>> Greg
>>>
>>> --
>>> | E R G O N O S I S
>>> | Greg Ederer
>>> | Lead Developer
>>> | greg@...
>>> | 360.774.6848
>>> |
>>>
>>> _______________________________________________
>>> FAQ: http://dojotoolkit.org/support/faq
>>> Book: http://dojotoolkit.org/docs/book
>>> Forums: http://dojotoolkit.org/forum
>>> Dojo-interest@...
>>> http://turtle.dojotoolkit.org/mailman/listinfo/dojo-interest
>>>
>>>
>> _______________________________________________
>> FAQ: http://dojotoolkit.org/support/faq
>> Book: http://dojotoolkit.org/docs/book
>> Forums: http://dojotoolkit.org/forum
>> Dojo-interest@...
>> http://turtle.dojotoolkit.org/mailman/listinfo/dojo-interest
>>
>
>
> _______________________________________________
> FAQ: http://dojotoolkit.org/support/faq
> Book: http://dojotoolkit.org/docs/book
> Forums: http://dojotoolkit.org/forum
> Dojo-interest@...
> http://turtle.dojotoolkit.org/mailman/listinfo/dojo-interest
>
_______________________________________________
FAQ: http://dojotoolkit.org/support/faq
Book: http://dojotoolkit.org/docs/book
Forums: http://dojotoolkit.org/forum
Dojo-interest@...
http://turtle.dojotoolkit.org/mailman/listinfo/dojo-interest

Re: error loading root children

by gederer :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Jared,

Thanks for explaining this!  I gave the object a name (the identifier prop name for this structure) and type, and it works now.

Cheers,

Greg

Jared Jurkiewicz wrote:
A nested object in an item is treated as another item.  See:
http://docs.dojocampus.org/dojo/data/ItemFileReadStore#items-with-hierarchy.
 In this case, you declare the identifier, then have an item that
doesn't have an identifier.  The load of that structure will fail in
the store.

-- Jared

On Sun, Oct 5, 2008 at 4:12 PM, Greg Ederer greg@... wrote:
  
Hi,

I use the JSON below to create an ItemFileReadStore, which I then use to
create a ForestStoreModel, which I use to create a Tree.  When I leave
out the 'months' property in the item with 'name' : 'RFE', it works
perfectly.  But, when 'months' refers to an {}, I get the following error:

 [Widget dijit.Tree, dijit_Tree_0] _connects=HTMLDivElement
_deferredConnects=Object : error loading root children:  TypeError: _48
is undefined message=_48 is undefined

I've tried using:

{
   'name' : 'RFE',
   'type' : 'dataset',
   'periodicities' : [ 'daily', 'dekadal', 'monthly' ],
   'selectedPeriodicity' : 'monthly',
   'units' : [ 'raw', 'percent', 'zscore', 'mmdifference', 'spi' ],
   'selectedUnits' : 'raw',
   'months' : {}
 }

as a test, and this doesn't work, either.  Is it permissible to have a
nested object in an item?

Here's the complete JSON:

{
 identifier : 'name',
 label : 'name',
 items : [
 {
   'name' : 'All Africa',
   'type' : 'region',
   'children': [
   {
     '_reference' : 'RFE'
   },
   {
     '_reference' : 'TPW'
   },
   {
     '_reference' : 'NDVI'
   },
   {
     '_reference' : 'WRSI'
   }
   ]
 },
 {
   'name' : 'East Africa',
   'type' : 'region',
   'children': [
   {
     '_reference' : 'RFE'
   },
   {
     '_reference' : 'TPW'
   },
   {
     '_reference' : 'NDVI'
   },
   {
     '_reference' : 'WRSI'
   }
   ]
 },
 {
   'name' : 'West Africa',
   'type' : 'region',
   'children': [
   {
     '_reference' : 'RFE'
   },
   {
     '_reference' : 'TPW'
   },
   {
     '_reference' : 'NDVI'
   },
   {
     '_reference' : 'WRSI'
   }
   ]
 },
 {
   'name' : 'South Africa',
   'type' : 'region',
   'children': [
   {
     '_reference' : 'RFE'
   },
   {
     '_reference' : 'TPW'
   },
   {
     '_reference' : 'NDVI'
   },
   {
     '_reference' : 'WRSI'
   }
   ]
 },
 {
   'name' : 'RFE',
   'type' : 'dataset',
   'periodicities' : [ 'daily', 'dekadal', 'monthly' ],
   'selectedPeriodicity' : 'monthly',
   'units' : [ 'raw', 'percent', 'zscore', 'mmdifference', 'spi' ],
   'selectedUnits' : 'raw',
   'months' : {
     '2003' : 'all',
     '2004' : 'all',
     '2005' : 'all',
     '2006' : 'all',
     '2007' : 'all',
     '2008' : [ '1', '2', '3', '4', '5', '6', '7' ]
   }
 },
 {
   'name' : 'TPW',
   'type' : 'dataset',
   'periodicities' : [ 'daily', 'dekadal' ],
   'selectedPeriodicity' : 'dekadal',
   'units' : [ 'raw', 'percent' ],
   'selectedUnits' : 'percent'
 },
 {
   'name' : 'NDVI',
   'type' : 'dataset',
   'periodicities' : [ 'daily', 'monthly' ],
   'selectedPeriodicity' : 'daily',
   'units' : [ 'raw', 'percent', 'spi' ],
   'selectedUnits' : 'spi'
 },
 {
   'name' : 'WRSI',
   'type' : 'dataset',
   'periodicities' : [ 'dekadal', 'monthly' ],
   'units' : [ 'raw', 'percent', 'zscore', 'spi' ],
   'selectedUnits' : 'zscore'
 }
 ]
}

Any thoughts?

Thanks!

Greg

--
| E R G O N O S I S
| Greg Ederer
| Lead Developer
| greg@...
| 360.774.6848
|

_______________________________________________
FAQ: http://dojotoolkit.org/support/faq
Book: http://dojotoolkit.org/docs/book
Forums: http://dojotoolkit.org/forum
Dojo-interest@...
http://turtle.dojotoolkit.org/mailman/listinfo/dojo-interest

    
_______________________________________________
FAQ: http://dojotoolkit.org/support/faq
Book: http://dojotoolkit.org/docs/book
Forums: http://dojotoolkit.org/forum
Dojo-interest@...
http://turtle.dojotoolkit.org/mailman/listinfo/dojo-interest
  


-- 
| E R G O N O S I S
| Greg Ederer
| Lead Developer
| greg@...
| 360.774.6848
|

_______________________________________________
FAQ: http://dojotoolkit.org/support/faq
Book: http://dojotoolkit.org/docs/book
Forums: http://dojotoolkit.org/forum
Dojo-interest@...
http://turtle.dojotoolkit.org/mailman/listinfo/dojo-interest

Re: error loading root children

by gederer :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

To my sensibilities, I think the easiest solution is just to give it an identifier, and type, and just not render it in the tree.

Thanks!

Adaltas wrote:
With the ItemFileReadStore, you can explorer this type of construct:

my_date: {"_type":"Date","_value":"2037-06-30"}

instead of

my_date: "2037-06-30"

I might be wrong, but it should work with objects as well as long as you 
define the type handler (Date here) but it is currently not supported by 
all store, ItemFileReadStore does.

Another alternative (not very cute), is to encode the object to json 
such as it become a string and decode it when you retrieve the value 
from the store.

d.


Jared Jurkiewicz a écrit :
  
A nested object in an item is treated as another item.  See:
http://docs.dojocampus.org/dojo/data/ItemFileReadStore#items-with-hierarchy.
 In this case, you declare the identifier, then have an item that
doesn't have an identifier.  The load of that structure will fail in
the store.

-- Jared

On Sun, Oct 5, 2008 at 4:12 PM, Greg Ederer greg@... wrote:
  
    
Hi,

I use the JSON below to create an ItemFileReadStore, which I then use to
create a ForestStoreModel, which I use to create a Tree.  When I leave
out the 'months' property in the item with 'name' : 'RFE', it works
perfectly.  But, when 'months' refers to an {}, I get the following error:

 [Widget dijit.Tree, dijit_Tree_0] _connects=HTMLDivElement
_deferredConnects=Object : error loading root children:  TypeError: _48
is undefined message=_48 is undefined

I've tried using:

{
   'name' : 'RFE',
   'type' : 'dataset',
   'periodicities' : [ 'daily', 'dekadal', 'monthly' ],
   'selectedPeriodicity' : 'monthly',
   'units' : [ 'raw', 'percent', 'zscore', 'mmdifference', 'spi' ],
   'selectedUnits' : 'raw',
   'months' : {}
 }

as a test, and this doesn't work, either.  Is it permissible to have a
nested object in an item?

Here's the complete JSON:

{
 identifier : 'name',
 label : 'name',
 items : [
 {
   'name' : 'All Africa',
   'type' : 'region',
   'children': [
   {
     '_reference' : 'RFE'
   },
   {
     '_reference' : 'TPW'
   },
   {
     '_reference' : 'NDVI'
   },
   {
     '_reference' : 'WRSI'
   }
   ]
 },
 {
   'name' : 'East Africa',
   'type' : 'region',
   'children': [
   {
     '_reference' : 'RFE'
   },
   {
     '_reference' : 'TPW'
   },
   {
     '_reference' : 'NDVI'
   },
   {
     '_reference' : 'WRSI'
   }
   ]
 },
 {
   'name' : 'West Africa',
   'type' : 'region',
   'children': [
   {
     '_reference' : 'RFE'
   },
   {
     '_reference' : 'TPW'
   },
   {
     '_reference' : 'NDVI'
   },
   {
     '_reference' : 'WRSI'
   }
   ]
 },
 {
   'name' : 'South Africa',
   'type' : 'region',
   'children': [
   {
     '_reference' : 'RFE'
   },
   {
     '_reference' : 'TPW'
   },
   {
     '_reference' : 'NDVI'
   },
   {
     '_reference' : 'WRSI'
   }
   ]
 },
 {
   'name' : 'RFE',
   'type' : 'dataset',
   'periodicities' : [ 'daily', 'dekadal', 'monthly' ],
   'selectedPeriodicity' : 'monthly',
   'units' : [ 'raw', 'percent', 'zscore', 'mmdifference', 'spi' ],
   'selectedUnits' : 'raw',
   'months' : {
     '2003' : 'all',
     '2004' : 'all',
     '2005' : 'all',
     '2006' : 'all',
     '2007' : 'all',
     '2008' : [ '1', '2', '3', '4', '5', '6', '7' ]
   }
 },
 {
   'name' : 'TPW',
   'type' : 'dataset',
   'periodicities' : [ 'daily', 'dekadal' ],
   'selectedPeriodicity' : 'dekadal',
   'units' : [ 'raw', 'percent' ],
   'selectedUnits' : 'percent'
 },
 {
   'name' : 'NDVI',
   'type' : 'dataset',
   'periodicities' : [ 'daily', 'monthly' ],
   'selectedPeriodicity' : 'daily',
   'units' : [ 'raw', 'percent', 'spi' ],
   'selectedUnits' : 'spi'
 },
 {
   'name' : 'WRSI',
   'type' : 'dataset',
   'periodicities' : [ 'dekadal', 'monthly' ],
   'units' : [ 'raw', 'percent', 'zscore', 'spi' ],
   'selectedUnits' : 'zscore'
 }
 ]
}

Any thoughts?

Thanks!

Greg

--
| E R G O N O S I S
| Greg Ederer
| Lead Developer
| greg@...
| 360.774.6848
|

_______________________________________________
FAQ: http://dojotoolkit.org/support/faq
Book: http://dojotoolkit.org/docs/book
Forums: http://dojotoolkit.org/forum
Dojo-interest@...
http://turtle.dojotoolkit.org/mailman/listinfo/dojo-interest

    
      
_______________________________________________
FAQ: http://dojotoolkit.org/support/faq
Book: http://dojotoolkit.org/docs/book
Forums: http://dojotoolkit.org/forum
Dojo-interest@...
http://turtle.dojotoolkit.org/mailman/listinfo/dojo-interest
  
    


_______________________________________________
FAQ: http://dojotoolkit.org/support/faq
Book: http://dojotoolkit.org/docs/book
Forums: http://dojotoolkit.org/forum
Dojo-interest@...
http://turtle.dojotoolkit.org/mailman/listinfo/dojo-interest

  


-- 
| E R G O N O S I S
| Greg Ederer
| Lead Developer
| greg@...
| 360.774.6848
|

_______________________________________________
FAQ: http://dojotoolkit.org/support/faq
Book: http://dojotoolkit.org/docs/book
Forums: http://dojotoolkit.org/forum
Dojo-interest@...
http://turtle.dojotoolkit.org/mailman/listinfo/dojo-interest

Re: error loading root children

by Nick Vujasin :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Jared Jurkiewicz <jared.jurkiewicz <at> gmail.com> writes:

>
> Yes, ItemFile*Store has the option of defining a custom data type as
> well, which will keep the store from treating nested objects of a
> specific form as a datastore item:
>
> http://docs.dojocampus.org/dojo/data/ItemFileReadStore#custom-types
>

Jared -

I'm trying to figure out how to get my 1.2 dojox.grid.DataGrid loaded with the
following store.  The ItemFileReadStore is erroring when trying to load the data
given below.  I am not using the 'files' attribute in the grid but when a row is
clicked on the grid I want to display the files that exist in the 'package' in
another pane.

My question is why does the store require you to provide the same identifier for
the children as the parent or force you to provide a custom type to convert a
simple object (i.e. my file object)?  I was hoping that the store, by default,
would be just that, a store that maintains exactly what was passed into it,
objects whose attributes are string values. If you needed to convert a field
into a specific type then at that point you can provide a conversion type to
convert the object.

If this is not the case, I am hoping you can show me how to convert the array of
file objects in a way the store will accept.

<span dojoType="dojo.data.ItemFileReadStore" jsId="jsonStore"
   data='{
      identifier:"package_name",
      label:"package_name",
      items:[{
         package_name:"Package1", product_name:"Product1",
         status:"Package Exported",
         files:[
            {file_name:"abc.mpg", file_size:"12MB"},
            {file_name:"cupcake.mpg", file_size:"8MB"}
         ]
      },{
         package_name:"Package2", product_name:"Product2",
         status:"BMS Package Deleted",
         files:[]
      }]}'></span>

Thanks
Nick


_______________________________________________
FAQ: http://dojotoolkit.org/support/faq
Book: http://dojotoolkit.org/docs/book
Forums: http://dojotoolkit.org/forum
Dojo-interest@...
http://turtle.dojotoolkit.org/mailman/listinfo/dojo-interest

Re: error loading root children

by jaredj :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

To answer:
   My question is why does the store require you to provide the same
identifier for the children as the parent or force you to provide a
custom type to convert a simple object (i.e. my file object)?

See the Dojo.data FAQ:
   http://docs.dojocampus.org/quickstart/data/usingdatastores/faq#question-9-in-one-of-my-items-in-itemfilereadstore-i-defined-an-attribute-value-as-a-javascript-object-when-i-access-it-through-store-getvalue-it-has-been-modified-why

All Javascript objects, including valus of attributes, are
automatically treated as a datastore item.  By spec, a datastore item
*must* have an identifier if the store supports the identity feature.
Since you declared your dataset has the identifier attribute
'package_name', then all datastore items must have that attribute
defined and it must be unique.  The only way around that is to tell
ItemFile*Store to treat certain things as not DataStore items, but as
a straight value of some sort, which means for the case of a complex
type, you use a CutomType so the store knows what to do with it.




On Mon, Oct 27, 2008 at 11:31 AM, Nick Vujasin <nick.vujasin@...> wrote:

> Jared Jurkiewicz <jared.jurkiewicz <at> gmail.com> writes:
>
>>
>> Yes, ItemFile*Store has the option of defining a custom data type as
>> well, which will keep the store from treating nested objects of a
>> specific form as a datastore item:
>>
>> http://docs.dojocampus.org/dojo/data/ItemFileReadStore#custom-types
>>
>
> Jared -
>
> I'm trying to figure out how to get my 1.2 dojox.grid.DataGrid loaded with the
> following store.  The ItemFileReadStore is erroring when trying to load the data
> given below.  I am not using the 'files' attribute in the grid but when a row is
> clicked on the grid I want to display the files that exist in the 'package' in
> another pane.
>
> My question is why does the store require you to provide the same identifier for
> the children as the parent or force you to provide a custom type to convert a
> simple object (i.e. my file object)?  I was hoping that the store, by default,
> would be just that, a store that maintains exactly what was passed into it,
> objects whose attributes are string values. If you needed to convert a field
> into a specific type then at that point you can provide a conversion type to
> convert the object.
>
> If this is not the case, I am hoping you can show me how to convert the array of
> file objects in a way the store will accept.
>
> <span dojoType="dojo.data.ItemFileReadStore" jsId="jsonStore"
>   data='{
>      identifier:"package_name",
>      label:"package_name",
>      items:[{
>         package_name:"Package1", product_name:"Product1",
>         status:"Package Exported",
>         files:[
>            {file_name:"abc.mpg", file_size:"12MB"},
>            {file_name:"cupcake.mpg", file_size:"8MB"}
>         ]
>      },{
>         package_name:"Package2", product_name:"Product2",
>         status:"BMS Package Deleted",
>         files:[]
>      }]}'></span>
>
> Thanks
> Nick
>
>
> _______________________________________________
> FAQ: http://dojotoolkit.org/support/faq
> Book: http://dojotoolkit.org/docs/book
> Forums: http://dojotoolkit.org/forum
> Dojo-interest@...
> http://turtle.dojotoolkit.org/mailman/listinfo/dojo-interest
>
_______________________________________________
FAQ: http://dojotoolkit.org/support/faq
Book: http://dojotoolkit.org/docs/book
Forums: http://dojotoolkit.org/forum
Dojo-interest@...
http://turtle.dojotoolkit.org/mailman/listinfo/dojo-interest