以下の例では、['active']['data']のように、['active']につづいて['data']キーが必要である。
public function buildRow(EntityInterface $entity) {
$row['active']['data'] = [ // @IMPORTANT: add ['data'] here
'#type' => 'checkbox',
'#default_value' => (bool) $entity->isActive(),
'#checked' => (bool) $entity->isActive(),
'#attributes' => ['disabled' => 'disabled'],
'#disabled' => TRUE,
];
return $row + parent::buildRow($entity);
}
リスト中なので、チェックボックスは表示するだけて編集不可にしたいが、その場合は
['disabled' => 'disabled']
のようにする(念のため'#disabled' => TRUE,も入れてはいるが)。