I have 4 grids that have the drag and drop plugin enabled. Their initial grid is dependent on a value from the db called state_id.
When I drop the selected row into a new grid, I update the state_id value and then tell it to sync up with the db and update the value for the item in question.
This works fine for the most part. I get this URL is undefined error when the following happens
This error only seems to happen when the first item being added to the grid originally came from the same grid.
drop event handler inside my controller:
dropit: function (node, data, dropRec, dropPosition) {
if (node.dragData.records[0].store.$className == "AM.store.BacklogCards")
{
data.records[0].set('state_id', 1);
this.getBacklogCardsStore().sync();
}
else if (node.dragData.records[0].store.$className == "AM.store.InprogressCards")
{
data.records[0].set('state_id', 2);
this.getInprogressCardsStore().sync();
}
else if (node.dragData.records[0].store.$className == "AM.store.ReviewCards")
{
data.records[0].set('state_id', 3);
this.getReviewCardsStore().sync();
}
else
{
data.records[0].set('state_id', 4);
this.getDoneCardsStore().sync();
}
//node.dragData.records[0].store.sync();
},
Any ideas on what is causing this and how to fix it?
Thanks
May I suggest that you use one store instead of three, and simply add three equal grids all using the same store, but with filtering on state=?
That way you can simply update the status on drop, refresh the two involved grids and synch the one store.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With