Mike Carey
Mike Carey

Reputation: 131

Having Issues Making Dojo Grid Cells Editable

I'm having difficulty getting my Dojo Grid to become editable. I'm using Dojo 1.3 from Google.

<script type="text/javascript" 
    src="http://ajax.googleapis.com/ajax/libs/dojo/1.3/dojo/dojo.xd.js"
    djConfig="parseOnLoad:true, isDebug: true"></script>

I've got my data in JSON format and it shows up correctly, but I can't get it to become editable with the table as I currently have it:

<div dojoType="dojo.data.ItemFileReadStore" jsId="dataStore" data="gridData"></div>
<table  id="gridNode"
        class="traitsContainer"
        dojoType="dojox.grid.DataGrid"
        store="dataStore"
        query="{}"
        singleClickEdit="true"
        selectable="true"
        editable="true"
        rowsPerPage="20">
    <thead>
        <tr>
            <th field="field1" selectable="true"
                    singleClickEdit="false" editable="false">
                Field 1
            </th>
            <th field="field2" selectable="true"
                    singleClickEdit="true" editable="true">
                Field 2
            </th>
            <th field="field3" selectable="true"
                    singleClickEdit="true" editable="true">
                Field 3
            </th>
            <th field="field4" selectable="true"
                    singleClickEdit="true" editable="true">
                Field 4
            </th>
            <th field="field5" selectable="true"
                    singleClickEdit="true" editable="true">
                Field 5
            </th>
        </tr>
    </thead>
</table>

Any ideas as to what I'm doing wrong?

Upvotes: 2

Views: 3810

Answers (1)

seth
seth

Reputation: 37277

You need to use an ItemFileWriteStore. The ItemFileReadStore is read-only.

Upvotes: 2

Related Questions