Dojo: ¿Guardar cambios con EnhancedGrid usando JsonRestStore?

I'm trying to use a EnhancedGrid and a JsonRestStore:

<script type="text/javascript">

/*set up data store*/
var store ={
target: "test/id"

/*set up layout*/
var layout = [[
{name: 'Column 1', field: 'id', width: '100px',  editable : true},
{name: 'Column 2', field: 'col2', width: '100px',  editable : true, type : dojox.grid.cells.Bool},
{name: 'Column 3', field: 'col3', width: '200px'},
{name: 'Column 4', field: 'col4', width: '150px', editable : true, type : dojox.grid.cells.Select, options : ['ON','OFF'] , values: [ '0', '1' ]}

/*create a new grid:*/
var grid = new dojox.grid.EnhancedGrid({
id: 'grid',
store: store,
structure: layout,
rowsPerPage: 5,
rowSelector: "20px",
selectionMode: "single",

/*append the new grid to the div*/

/*Call startup() to render the grid*/
<style type="text/css">
@import "/js/dojox/grid/resources/claroGrid.css";

/*Grid need a explicit width/height by default*/
#grid {
width: 80em;
height: 40em;
<div id="gridDiv" class="claro"></div>

On the server side I have a Rest service which handles Get, Put, Post and Delete requests.

I have two distinct problems, but I wonder wether they are linked:

1- When I double click on any of the editable cells it works fine, I can change the cells' content. But then I can't edit any other editable cell. No matter on which one I click, I won't be able to edit it. For instance if I double click on the 'Select' cell, I will be able to select between the two values, ON or OFF. But then I can no longer edit any other cell. The cell I've just edited will remain displayed with an arrow, and his row will remain selected.

2- The server will never receive any PUT requests. It will receive the GET requests on the initial display and when I scroll the grid, but this is the only REST request I will get on the server side. So I can't figure how to make and save any changes in the grid!

¿Cualquier pista?

preguntado el 01 de febrero de 12 a las 03:02

Please provide working example based on: -

0 Respuestas

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.