Login Register

ItemFileWriteStore

new updating method for _pending in ItemFileWriteStore

Hi,

The dojo.data.ItemFileWriteStore has a built-in mechanism to help developpers track pending items for updating purpose.
An internal object called _pending is initialized when the object is created:

this._pending = {
        _newItems:{},
        _modifiedItems:{},
        _deletedItems:{}
};

Then, when the store is updated (either by a new, update or delete operation) this object is modified accordingly.
For the update, there is a test in the _setValueOrValues function to avoid registering twice the updated item:

if(!this._pending._modifiedItems[identity]){ ... }

error: dojo.data.ItemFileWriteStore is not a constructor

Following examples don't work with option debugAtAllCosts = true

dojox/grid/tests/test_grid_layout.html
dojox/grid/tests/test_grid_layout_LayoutContainer.html

I get an error in Firebug

dojo.data.ItemFileWriteStore is not a constructor
test_store = new dojo.data.ItemFileWriteStore({data: data});

I can just simply switch this option to false but would like to know a reason. Did anyone of you come across this?

Datagrid with DateTextBox edit cell and newItem

I have an editable datagrid(1.2.3) up and runnning fine. To make it sort date columns correctly, I formatted my json data to have date objects in the format:

dateobj:{_type:'Date',_value:'2008-12-03T00:00:00-08:00'}

Here is my grid declaration:

ItemFileWriteStore lingers in memory??

Hi. I'm having a strange problem - and am wondering if it's b/c of some handling of memory that I haven't grocked. Here's the scenario:

* I instantiate an object from a class that has an ItemFileWriteStore as one of its properties.

* A class method loads data into the ItemFileWriteStore

* I instantiate a second object from the same class. Now when I load data into its ItemFileWriteStore, I get an error on myStore.newItem().

ItemFileWriteStore; problems with _saveCustom method

I'd like to send all pending changes to my backend using the save() method of the ItemFileWriteStore. The suggestion in the Dojo Book is to use my own method; either _saveEverything or _saveCustom. I'd don't want to send everything, so _saveCustom made sense for my needs.

In order to build a serializable structure containing all of the modified data items, I am iterating over the store._pending object and its three containers. I want to copy the data into some simple objects and arrays, and then send them to my server as JSON.

Trying to detect changes in ItemFileWrite Store so I can write to server

Hi,

I'm using an ItemFileWriteStore as the backend to a Grid (1.2 style). One of my columns has a dojox.grid.cells.Bool. I'm trying to let the server know via rpc when the box is checked/unchecked.

I subclassed ItemFileWriteStore to add a "_saveCustom" as described in the documentation.

Here is my code:


dojo.declare("CustomItemFileWriteStore", dojo.data.ItemFileWriteStore, {
_saveCustom: function(saveCompleteCallback, saveFailedCallback){
// xhrPost/xhrPut your data back to your server (convert it to
the server format first if need be)

Can't save the new data to the json file in ItemFileWriteStore.

I defined a ItemFileWriteStore named 'store' in dojo 1.1. And set a new value into the store. But it can't update the new data into the json file.

dojoType="dojo.data.ItemFileWriteStore" jsId="store" url="/json/treeTest.json"
......
store.save();

It not prompt any error, but the data in treeTtest.json isn't changed.

How to save the data of ItemFileWriteStore into json file ?

I use dojo 1.1 to define a ItemFileWriteStore named "store". For example:

dojoType="dojo.data.ItemFileWriteStore" jsId="store" url="/json/treeTest.json"

After modify the data of store, I want to save the new data to the file "treeTest.json". So I call store.save(); But the data in "treeTest.json" didn't been changed.

I don't know how to update the data into the file actually, can you help me?

Dojo 1.2 ItemFileWriteStore revert() breaking Grid with data that is both New and Modified

I found a problem in one of my applications under the 1.2.0 release with using revert().

In this simplified code, I create a grid with a ItemFileWriteStore behind it. If I edit the data in the grid, and then call revert(), the edits are reverted correctly. If I create a new row using store.newItem(), and then call revert() immediately, the new row disappears. But if I create a new row and THEN edit the field in the new row, when I use revert() my Grid disappears and says "Sorry, an error occurred." This behavior is consistent across FF2, FF3, and IE7.

ItemFileWriteStore breaks dojo.data.api.Write's contract

I just designed a dijit Tree using ItemFileWriteStore with the implicit guarantee of the documentation accompanying the dojo.data.api.Write interface (I'm using dojo 1.1.1). Each data item is backed by a file in a standard file system on the server. As anyone knows, files are uniquely identified by their full file path.

The problem I encountered with ItemFileWriteStore is that it threw an error when I tried to use setValue on the attribute that doubles as the unique identifier (file path). If the user renames the tree node label, in effect he's changing the name of the file on the back-end, hence the path needs to be updated.

Syndicate content