Problem/Motivation

It would be nice to be able to lock items when using table drag; to support this the tabledrag script should account for this disabled/locked items when updating weights.

Issue fork drupal-3388503

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

casey created an issue. See original summary.

casey’s picture

Status: Active » Needs work
StatusFileSize
new682 bytes
new682 bytes

Something like this would work.

To lock a row, it should not have a draggable class and its weight should be disabled. Also, this patch only works for (not select) inputs as weight.

gauravvvv’s picture

StatusFileSize
new665 bytes
new468 bytes

Fixed ccf issue, attached interdiff for same

joachim made their first commit to this issue’s fork.

joachim’s picture

Converted this to an MR with the patches so far committed.

I can see a corner case which this does not handle yet: suppose two locked items have the *same* weight.

It should not be possible to drag an item in between these two items, because there is no way to set a weight to go in between them.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.