Login Register

ItemFileWriteStore

Problems updating multiple Trees with ItemFileWriteStore

Hello all:

I'm pretty new to Dojo, and I'm really impressed with it so far. I've run into a small snag with the Tree widgit though, and was wondering if I'm doing something wrong, or if I've found a bug.

I have an ItemFileWriteStore, reading JSON data from my server. There are two types within this data: 'folders', and 'items'. As you might suspect, an 'item' resides within a folder.

I have two trees. The first tree displays folders, and the item children of the folders. The second tree displays all items.

Querying the Grid using the index of the row.

I am just making my baby steps around the Dojo world. I am amazed at all the things I did not know :-).

My question is what is the best way to fetch a row from using the row index from the Grid?

I have a custom store that extends ItemFileWrite store. This store has a method , saveItem with the following body.

<javascript>

saveItem:
function( index,
templateToSave,
postUrl,
postVariable,
_onLoad,
_onError) {

deleteItem on ItemFileWriteStore dosent work

We used

var fruitStore=new dojo.data.ItemFileWriteStore(data);
to create a store from a json tree data.

Later we deleted one item using...
fruitStore.deleteItem(item);

When we wanted to insert the item again at a different tree node , I get a data store exception.

--- > Error: newItem() was not passed an single-valued identity'

Dosen't the delete remove the object from the tree and the datastore ???

And also when we use

items = fruitStore.getValues(parentItem,"children"); ,

Using modified JSON Store w/ Grid

Hello,

I am currently in the process of trying to implement a grid using a JSON store. I have successfully done this with a JSON file that followed the ItemFileReadStore.js requirements of using an items array. I have recently been trying to figure out how best to use a custom JSON store hierarchy with my grid. The store looks like the following:


{
"top": [
{"id":1, "name": "Name1", "width":2,
"first":[
{"card":1, "circuit":7},
{"card":1, "circuit":8}

HowTo: Programmatically create ComboBox/FilteringSelect widgets

I've noticed a number of people ask how to create the store needed for these kinds of widgets and the method isn't really document in the dojo book. After some digging around I found how to create these widgets programmatically and thought I'd share the solution:

dojo.require("dijit.form.ComboBox");
dojo.require("dojo.data.ItemFileWriteStore");
var jsonData = { identifier: "index", items: [], label: "number" };
var phoneNumberStore = new dojo.data.ItemFileWriteStore( { data: jsonData } );
phoneNumberStore.newItem({index:0,number:"805 232-4242"});

Adding items to ItemFileWriteStore in a specific index

Hi All,
Is there a way to add item/s to an ItemFileWriteStore in a specific index in the store? e.g., say I have a store with items a, b, d, and I'd like to add 'c', but I want it to be after 'b' and not to append it.
thanks
Yoav

Syndicate content