How to make EntityListBuilder sortable?
This is how i sort my entityListBuilder :

i use the method load() : 

  public function load() {

    $entity_query = \Drupal::service('entity.query')-&gt;get('produits_entity');
    $header = $this-&gt;buildHeader();

    $entity_query-&gt;pager(50);
    $entity_query-&gt;tableSort($header);

    $uids = $entity_query-&gt;execute();

    return $this-&gt;storage-&gt;loadMultiple($uids);
  }


Then i build my header like this :

  /**
   * {@inheritdoc}
   */
  public function buildHeader() {

    $header = array(
        'id' =&gt; array(
            'data' =&gt; $this-&gt;t('N° produit'),
            'field' =&gt; 'id',
            'specifier' =&gt; 'id',
            'class' =&gt; array(RESPONSIVE_PRIORITY_LOW),
        ),
        'nom' =&gt; array(
            'data' =&gt; $this-&gt;t('Nom'),
            'field' =&gt; 'name',
            'specifier' =&gt; 'name',
        ),

        'prixHT' =&gt; array(
            'data' =&gt; $this-&gt;t('Prix HT'),
            'field' =&gt; 'prixHT',
            'specifier' =&gt; 'prixHT',
        ),

        'statut' =&gt; array(
            'data' =&gt; $this-&gt;t('Actif'),
            'field' =&gt; 'actif',
            'specifier' =&gt; 'actif',
        ),

    );

    return $header + parent::buildHeader();
  }


you need to add in your buildHeader() 2 param for each field you want sort :


  name of field and specifier