-- Cameron <[email protected]> wrote
(on Thursday, 24 September 2009, 02:53 PM +0800):
> On Thu, Sep 24, 2009 at 8:38 AM, Cameron <[email protected]> wrote:
>     On Wed, Sep 23, 2009 at 6:49 PM, Matthew Weier O'Phinney 
> <[email protected]>
>     wrote:
>         -- Cameron <[email protected]> wrote
>         (on Wednesday, 23 September 2009, 09:42 AM +0800):
>         > Dojo grids. I've actually just moved a lot of my functionality over
>         to Dojo
>         > JsonRestStore so I can do in-grid editing, it's not completed yet,
>         but so far
>         > it is coming together really smoothly.
> 
>         I'm planning on doing a blog post on this combination (Zend_Rest_Route
>         +
>         dojox.data.JsonRestStore + dojox.grid.DataGrid) -- the three work
>         together incredibly well, and make CRUD interfaces a breeze.
> 
> 
>     So far I'm finding the same, it's a match made in heaven, except for some
>     reason the grid doesn't seem to be triggering on edits. I can't see any
>     ajax hits in firebug. Anyway, I'm sure it's my fault, I'll work it out!
> 
> 
> Ok, so I'm dumb, you need to manually call store.save().

I was about to write back and mention that you need to trigger
store.save() -- glad you found it. (In my identifier column, I typically
add a "save" button to trigger this.)

> Matthew, one thing that your post should cover over is the handling of error
> conditions - I'm struggling to find any examples of neatly dealing with what
> happens if your controller decides it's not happy with the data and has to let
> the store know so it can deal with the situation appropriately.

When you call store.save(), you can pass onError and onComplete
callbacks. In the case of an error, I return an HTTP 400 status with a
JSON payload with my error messages, and then popup a dialog indicating
what needs to be changed; for success messages, I use a notification
system (currently one derived from
http://blog.uxdriven.com/2009/09/08/making-your-own-growl-widget-with-dojo/)

The place that problems occur is when I add new rows -- Dojo generates a
unique hash for the ID, but that means that if I save() a second time,
JsonRestStore tries to do a PUT (update) request -- and I have an
invalid identifier. I'm still trying to work out that part of the
equation.


>         > On Tue, Sep 22, 2009 at 9:10 PM, Kyle Spraggs <[email protected]>
>         wrote:
>         >
>         >     I was curious what everyone is using for DataGrids. I am aware 
> of
>         http://
>         >     petala-azul.com/blog/ as well as http://code.google.com/p/
>         >     zend-framework-datagrid/ and there is also the possibility of
>         Dojo Grids.
>         >     Any input would be appreciated.
> 
>         --
>         Matthew Weier O'Phinney
>         Project Lead            | [email protected]
>         Zend Framework          | http://framework.zend.com/
> 
> 
> 
> 

-- 
Matthew Weier O'Phinney
Project Lead            | [email protected]
Zend Framework          | http://framework.zend.com/

Reply via email to