Drag And Drop In Grid View

Hi, i’m using this link for ordering data in grid view by drag and drop.


It works fine, but after adding a file filed in model, the drag and drop work and new order not saved to the database.

model file field

array('image_file', 'file','types'=>'jpg, gif, png'),

How it can solve?


try this…

array('image_file', 'file','allowEmpty' => TRUE,'types'=>'jpg, gif, png'),

i am not sure it’s work or not…

Hey, image_file is a mandatory field.!

When you call save() on the model in the sort action it calls validation internally. It fails, because no file has been uploaded.

In the validation rules of your model create another scenario where file is not required and use it in the sort action.