SitePen/dgrid — pull request #949 by mercmobily (2014-06-04 00:02:04+00:00)
Title: Initial attempt to DnD improvements for dgrid 0.4

Hi,

This is the same pull request for #808, but targeting dgrid 0.4.
Sorry if this is not "the" way this is meant to be done (two pull requests targeting two different branches).

I started using dgrid with my Json REST stores, and noticed a couple of problems.

1) No dgrid-error was emitted if there was an AJAX error. This meant that it was hard for my application to display an error in the error bar at the top if an error happened (I didn't really want to aspect() around the stores' methods etc.)

2) If the put() onto the destination store failed, but the remove() from the source store worked, you ended up deleting an item (!) rather than moving it (!!). Basically, remove() should only ever be called if the previous put() has worked.

I fixed both of these in DnD.js. I would have created two different pull requests, but they would have conflicted with each other badly.

This pull request fixes #805 and #806

NOTE: I haven't tested this pull request yet, as my app is half-functional after the switch to dstore. I haven't yet added the emitting code yet. Will do _very_ shortly (I need to create a pull request for dstore, get my app to actually work again, and test the lot).