Login Register

dojo.data

dojo.data stores: How to use regexp queries to get result set?

I have a items in a data store that have a position object. For an array of items in the store, here's a sampling of the position attributes that the items might have:

position : 1
position : 1.1
position : 1.15
position : 1.15.1
position : 1.2.7
position : 2
position : 2.1

While it's easy enough to issue a query to the store for all position 1 items, such as query:{position:'1'}
- returns example 1 above

and it's pretty easy to issue a query for all level 1 items, such as query:{position:'?'}
- returns example 1 and 6 above

partiallyResolved: how to add clientside pagination

I am new to dojo, just got a big headache :-( when working on client-side pagination. But I really love Dojo, and want to use it :-) .
The demo somewhere in forum is just not working in Dojo1.1. http://osdir.com/ml/web.dojo.devel/2006-10/msg00013.html

** Error found:
With coding and Json below, I can only go to next item, but then got a problem which actually already reported here in forum ( dojo datastore automatically combined (messed up?) with previous store fetched).
In console, it just showed combined page1 and page 2, but I can never navigate to page 3. Why ??

Zend Framework JSON-RPC service + dojo.data + dojox.grid?

I'm trying to figure out how to plug in a JSON-RPC service with a grid.

There doesn't seem to be a dojo.data store for json-rpc, however all the plumbing is there for doing the rpc calls. Anyone have suggestions on how to go about this?

My service controller (Zend Framework) looks something like this:

public function jsonAction ()
{
$server = new Zend_Json_Server();
$server->setClass("MyClass_RPC_" . $this->_getParam('class'));
$server->setAutoEmitResponse(true);
if ('GET' == $_SERVER['REQUEST_METHOD']) {

XML backend for dijit trees and grids

For the last couple of days, I've been trying to find the way to use the XML backend of the dijit.Tree widget, as the documentation says it should be possible. Quoting http://dojotoolkit.org/node/3157:

The easiest data-driven way to approach this uses dojo.data. Dojo.data reminds Andy of ODBC in the Windows world, JDBC in Java, and DBD in PHP (Andy gets around.) Though dojo.data can talk to many different kinds of backing stores formatted in CSV, XML or HTML, Andy picks JavaScript Object Notation, or JSON.

Dojo.data Issues

I am playing around with Dojo, and I wanted to be able to store start/end times in some sort of data store. However, storing the items has caused me some trouble. Below I have given relevant code..


  var store = new dojo.data.ItemFileWriteStore({url: '/data/store.json'});
  
  // Passing in a random/unique id
  function startTime(id) {
    timers[id] = new Date();
			
    var storeTime = store.newItem({timerId: '1234', type: 'start', time: timers[id] });
    store.save({onComplete: saveDone, onError: saveFailed});

    var gotName = function(items, request) {

How to create dojo tree data object variable dynamically?

I would like to create a variable like this one dynamically? I could not find an example anywhere where I could create such variable.

var dataVariable = { identifier: 'name',
label: 'name',
items: [
{ name:'Africa', type:'continent',
children:[{_reference:'Egypt'}, {_reference:'Kenya'}, {_reference:'Sudan'}] },
{ name:'Egypt', type:'country' },
{ name:'Kenya', type:'country',
children:[{_reference:'Nairobi'}, {_reference:'Mombasa'}] },
{ name:'Nairobi', type:'city' },
{ name:'Mombasa', type:'city' },

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.

Syndicate content