Drag n drop - hinder certain rows from being dragged
Considering this code I'm using for drag n drop:
- $(".gridview").sortable({
- //items: 'tr:not(tr:first-child)',
- items: 'tr',
- cursor: 'pointer',
- axis: 'y',
- dropOnEmpty: false,
- start: function (e, ui) {
- ui.item.addClass("selected");
- },
- stop: function (e, ui) {
- ui.item.removeClass("selected");
- },
- });
I would like to lock some rows based on the cell value. Maybe I could use something like 'tr:not(tr:first-child)', but instead based on the cell value rather than first, second and so on.
So I would prevent some rows from being dragged by the USER, but still I want these rows the be able to change position if neccessary. For instance if a row is dragged above a "non-dragable-row", the non-dragable-row still needs to be able to move down one step.
So most of the rows would be dragable, then a few will be non dragable, but in code behind they would still need to be able to change position.
How could this be done, if possible?