[dojo-contributors] ItemFileReadStore question -- Anyone see why this wouldnt work? I'm stumpped...

Jared Jurkiewicz jared.jurkiewicz at gmail.com
Thu Sep 11 15:37:16 EDT 2008


     As with data obtained from URLs, the data objects are not parsed
or inserted into any arras until the first actual query via fetch(),
fetchItemByIdentity, etc.   Effectively it doesn't waste time parsing
anything until it actually needs to.

-- Jared


On Thu, Sep 11, 2008 at 3:14 PM, Karl Tiedt <ktiedt at gmail.com> wrote:
> Sorry for the wasted email everyone, I figured it out finally...
>
> when loading data from a JSON var... _forceLoad() must be called (if not
> connected to a widget) is what I've found... otherwise the widget does it
> for you. I was merely trying to validate my data format... any attempt to
> access data (fetch or query) sounds like it should force the laod as well as
> far as that goes... was just a tad disconcerting to keep seeing 0 length
> data arrays coming up :/
>
> -Karl Tiedt
>
>
> On Thu, Sep 11, 2008 at 1:50 PM, Karl Tiedt <ktiedt at gmail.com> wrote:
>>
>> I have the following JSON:
>>
>> {
>> 	"identifier": "uuid",
>> 	"items": [
>> 		{
>> 			"Power State": "On",
>> 			"Boot Time": "2008-08-30T23:50:06.028558-04:00",
>>
>>
>> 			"Host Name": "poweredOn",
>> 			"IP Address": "2008-08-30T23:50:06.028558-04:00",
>> 			"Name": "New Virtual Machine",
>> 			"Operating System": "Microsoft Windows Server 2003, Standard Edition
>> (32-bit)",
>>
>>
>> 			"uuid": "564dd5b0-b887-4041-bcfe-4896e6040547"
>> 		},
>> 		{
>> 			"Power State": "On",
>> 			"Boot Time": "2008-08-20T02:15:57.63562-04:00",
>> 			"Host Name": "sergey-8227caed.",
>>
>>
>> 			"IP Address": "192.168.1.51",
>> 			"Name": "Foo",
>> 			"Operating System": "Microsoft Windows XP Professional (32-bit)",
>>
>>
>> 			"uuid": "564d36e4-6cea-e0e8-5216-3766ef2a3bd0"
>> 		}
>> 	],
>> 	"label":
>>
>> And I am trying to create a store from it...
>> test = new dojo.data.ItemFileReadStore({'data': varName});
>>
>> and it always comes back with 0 items... I've tried adding 'label': 'Name'
>> and 'identifier':'uuid' to the JSON object but... neither made a
>> difference... I've tried replacing the spaces in the property names and
>> removing the -'s from the uuid....
>>
>> Stumped :(
>>
>> -Karl Tiedt
>
>
> _______________________________________________
> dojo-contributors mailing list
> dojo-contributors at dojotoolkit.org
> http://turtle.dojotoolkit.org/mailman/listinfo/dojo-contributors
>
>



More information about the dojo-contributors mailing list