Login Register

dojo.data

dojo.data query populated store

What I would like to do is:
instantiate store -> call fetch to get the data -> at a later time, run queries on this already populated store to return by a particular attribute in the store.

For instance, this will populate the store:

var store = new dojo.data.ItemFileReadStore({jsId:"cacheFirst",
url:"getCache.php?test_ids="+test_ids+"&page_id="+page_id+"&min_time=first&max_time=first&order=ASC&limit="+limit });
var processCache = function(items,request){
cache_first = items;

/* default to the first item */

bug in dojo.data.ItemFileWriteStore?

Maybe I'm doing this wrong but this code fails for me every time:

dojo.require("dojo.data.ItemFileWriteStore");

var store = new dojo.data.ItemFileWriteStore( { url: "countries.json"} ); // from dojo/tests/data directory
// comment out this line if you want newItem to succeed.
store.fetchItemByIdentity( { identity: "ec", onItem: function(item) { console.log("found " + store.getValue(item,"name") ); } } );
var canada = store.newItem( { name: "Canada", abbr: "ca", capital: "Ottowa" } );

Dojo.data Notification events and easy passing of store references to generic event handlers.

A while ago I was working with another committer in the dojo community on usage of the dojo.data notification APIs. He had hit a problem where it would have been really convenient if the dojo.data Notification functions onSet(), onNew(), and onDelete(), also passed in a reference to the store.

ItemFileReadStore close does nothing?

In looking at the source for the ItemFileReadStore I see that close() is not implemented? Is there any plans to implement this or is it intended that this is supposed to be extended?

I think this would be a useful thing to implement in the core.

dojo.data.api.Write - setValues function

In the dojo.data.api.Write declaration, it states for the function setValues that...

// Calling store.setValues(x, y, []) (with *values* as an empty array) has
// the same effect as calling store.unsetAttribute(x, y).

I find that if you pass setValues a blank array, it should NOT have the affect of store.unsertAttribute(x, y).

how to retrieve the json format data from dojo.data (like ItemFileWriteStore)

I have a ItemFileWriteStore like this:

{identifire:'id',
label:'name',
items:[id:'1',name:'cpu',type:'component',children[{id:'1.1',name:'cpu0',type:'device'}]]
}

then I modified some datas by using the identity and write API [fetchItemByIdentity() & setValue() functions]
but I can't retrieve the json format data form the store.In the other words,I can't get the data structure below from the data store.

{identifire:'id',
label:'name',
items:[id:'1',name:'memory',type:'component',children[{id:'1.1',name:'/dev/mem',type:'device'}]]
}

Need Help!

dojo.data getTagCloud(attribute)

Is there an easy way to retrieve a tag cloud from a specific dojo.data store's item attribute? Would be nice if this was available as a ready to use function, like getValues.

-Ivo

Are you able dojo.connect to a dojo.data stores event like dojo.connect(myStore, "onItem", function() { console.log("item") });?

It seems like you should be able to but this didn't work for me. myStore is a jsId.

dojo.connect(myStore, "onItem", function() { console.log("item") });

I'm looking for suggestions on a better way to iterate through my dojo.data store to decrease # of iterations

Sorry that's a pretty vague subject. What I have is a store of items like this:

items: 
[
  { name: "button", category: "core", imageSrc: "image.png", label: "Button", description: "It's a button!" }, 
  and repeat...
]

Grid with remote combobox

Hey,

I was wondering how I can let a combobox use remote data for the grid (using a store). Following code does not seem to work:

var combocarddef = new dojo.data.ItemFileReadStore({jsId: 'carddefStore', url: '/mack/ajaxdataprovider/get/'});
       
var viewCardDef = {
          cells: [[
{name: 'Type', field: "type", editor: dojox.grid.editors.Dijit,
                                        editorClass: "dijit.form.ComboBox", store: combocarddef},
.....

Thanks a lot,

nikolai

Syndicate content