public function build($id = '', $class = '', $withCheckbox = false, $withBorder = true)
    {
        // Set element attributes
        $id = $id ?: 'dt' . mt_rand();
        $this->attr('id', $id);
        $this->addClass($class);

        // Set object variables
        $this->checkable = (!$withCheckbox ? false : true);
        $this->checkList = (!$withCheckbox ? null : []);

        // Add extra classes
        if ($this->checkable) {
            $this->addClass('checkable');
        }
        if ($withBorder) {
            $this->addClass('dgl_wb');
        }

        // Create grid list
        $this->gridList = $this->getFormFactory()->buildHtmlElement('ul', '', '', 'DataTableList');
        $this->append($this->gridList);

        return $this;
    }
public function build($id = '', $class = '', $withCheckbox = false, $withBorder = true)
    {
        // Set element attributes
        $id = $id ?: 'dt' . mt_rand();
        $this->attr('id', $id);
        $this->addClass($class);

        // Set object variables
        $this->checkable = (!$withCheckbox ? false : true);
        $this->checkList = (!$withCheckbox ? null : []);

        // Add extra classes
        if ($this->checkable) {
            $this->addClass('checkable');
        }
        if ($withBorder) {
            $this->addClass('dgl_wb');
        }

        // Create grid list
        $this->gridList = $this->getFormFactory()->buildHtmlElement('ul', '', '', 'DataTableList');
        $this->append($this->gridList);

        return $this;
    }
public function build ( $ id = '' , $ class = '' , $ withCheckbox = false , $ withBorder = true ) { // Set element attributes $ id = $ id ? : 'dt' . mt_rand ( ) ; $ this -> attr ( 'id' , $ id ) ; $ this -> addClass ( $ class ) ; // Set object variables $ this -> checkable = ( ! $ withCheckbox ? false : true ) ; $ this -> checkList = ( ! $ withCheckbox ? null : [ ] ) ; // Add extra classes if ( $ this -> checkable ) { $ this -> addClass ( 'checkable' ) ; } if ( $ withBorder ) { $ this -> addClass ( 'dgl_wb' ) ; } // Create grid list $ this -> gridList = $ this -> getFormFactory ( ) -> buildHtmlElement ( 'ul' , '' , '' , 'DataTableList' ) ; $ this -> append ( $ this -> gridList ) ; return $ this ; }
Build the datatable.

@param string $id
@param string $class
@param bool   $withCheckbox If set to TRUE, the dataGridList will have a checkbox at the start of each row.
@param bool   $withBorder   Defines whether the gridList will have visual border.

@return $this
@throws InvalidArgumentException
@throws Exception
Build the datatable .