Login Register

dojo.data.ItemFileWriteStore

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) {

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" } );

Populating a tree with a server call works fine only the first time

I use thid code on my jsp page.

On IE it works fine only the first time.
When I reload the page to load new data from server, the tree doesn't loads properly, and tree seems to load the same data stored on first time.

On Firefox I don't have any problem and tree works fine every time.

is it a caching problem? Is there a way to solve my problem?

Syndicate content