OpenSkill\Datatable\Views\DatatableView::id PHP Method

id() public method

Will set a new id on the table.
public id ( string $tableId )
$tableId string The new id that should be used for the DOM table
    public function id($tableId)
    {
        if (!is_string($tableId)) {
            throw new \InvalidArgumentException('$tableId should be a string');
        }
        $this->tableId = $tableId;
        return $this;
    }

Usage Example

 public function testId()
 {
     $this->viewFactory->shouldReceive('make')->withArgs(['fooTable', ['columns' => ['id' => 'id'], 'showHeaders' => false, 'id' => 123, 'endpoint' => '/']])->times(1)->andReturn($this->view);
     $this->dtv2->id("123");
     $this->dtv2->table();
 }