Change record status: 
Project: 
Introduced in branch: 
10.1.x
Introduced in version: 
10.1.0
Description: 

The new TabledragWarningCommand is used for marking a tabledrag row as changed and adding a "You have unsaved changes." warning if one is not yet present. Previously, marking a row as changed and adding this warning could only be done via direct JavaScript invocation of the tabledrag object.

This was added so the UI could properly update when an item in a tabledrag form was changed via AJAX. Adding this command to the update response ensures the changed row receives a tabledrag changed marker, and the unsaved changes warning is added above the table.

$response->addCommand(new TabledragWarningCommand($id_of_the_row_that_changed, $tabledrag_instance_identifier))
// $tabledrag_instance_identifier is the array key for accessing the tabledrag instance in Javascript, f.e. it would be 'field-display-overview'
// if the tabledrag instance was available via Drupal.tableDrag['field-display-overview']
Impacts: 
Module developers