private function appendSimpleRow($contents, $class = '', $header = false)
    {
        // Check width size
        if ($this->hSize == 0) {
            throw new LogicException('There are no headers set on the datatable yet.');
        }

        // Create grid row object
        $gridRow = $this->getFormFactory()->buildHtmlElement('li', '', '', ($class == '' ? 'DataTableRow' : $class));

        // Trim contents to the column size
        if ($this->hSize < count($contents)) {
            array_slice($contents, $this->hSize);
        }

        // Add extra columns
        $contentsCount = count($contents);
        for ($i = 0; $i < $this->hSize - $contentsCount; $i++) {
            $contents[] = $this->getFormFactory()->buildHtmlElement('span');
        }

        // Insert contents to row
        foreach ($contents as $key => $contentValue) {
            // Create item identifier
            $itemIdentifier = '';
            if (gettype($key) == 'string') {
                $itemIdentifier = strtolower(str_replace(' ', '', $key));
            } elseif (gettype($contentValue) == 'string' || gettype($contentValue) == 'integer' || gettype($contentValue) == 'double') {
                $contentValue = '' . $contentValue;
                $itemIdentifier = strtolower(str_replace(' ', '', $contentValue));
            } elseif ($contentValue->tagName == 'span') {
                $itemIdentifier = strtolower(str_replace(' ', '', $contentValue->nodeValue));
            }

            // Set text wrapper
            $gridTextWrapper = $this->getFormFactory()->buildHtmlElement('span', $contentValue, '', 'DataTableTextWrapper');

            // Set item style
            $gridTextWrapper->appendAttr('style', 'max-width:100%;width:100%;box-sizing:border-box;');

            // Create grid cell with given text
            $gridCell = $this->getFormFactory()->buildHtmlElement('div', $gridTextWrapper, '', 'DataTableCell');
            $gridRow->append($gridCell);

            // Set header (if any)
            if ($header && !empty($itemIdentifier)) {
                // Set identifier
                $gridCell->data('column-name', $itemIdentifier);

                // Add sorting icon
                $sortingIcon = $this->getFormFactory()->buildHtmlElement('div', '', '', 'sortingIcon');
                $gridTextWrapper->append($sortingIcon);
            }

            // Set grid item width
            if (empty($this->columnRatios)) {
                $ratio = (!$this->checkable ? 100 : 100 - 8);
                $w = $ratio / $this->hSize;
            } else {
                $w = $this->columnRatios[$key];
            }
            $gridCell->attr('style', 'width:' . $w . '%;');
        }

        // Append grid row to grid list and return the DOMElement
        $this->gridList->append($gridRow);

        return $gridRow;
    }
private function appendSimpleRow($contents, $class = '', $header = false)
    {
        // Check width size
        if ($this->hSize == 0) {
            throw new LogicException('There are no headers set on the datatable yet.');
        }

        // Create grid row object
        $gridRow = $this->getFormFactory()->buildHtmlElement('li', '', '', ($class == '' ? 'DataTableRow' : $class));

        // Trim contents to the column size
        if ($this->hSize < count($contents)) {
            array_slice($contents, $this->hSize);
        }

        // Add extra columns
        $contentsCount = count($contents);
        for ($i = 0; $i < $this->hSize - $contentsCount; $i++) {
            $contents[] = $this->getFormFactory()->buildHtmlElement('span');
        }

        // Insert contents to row
        foreach ($contents as $key => $contentValue) {
            // Create item identifier
            $itemIdentifier = '';
            if (gettype($key) == 'string') {
                $itemIdentifier = strtolower(str_replace(' ', '', $key));
            } elseif (gettype($contentValue) == 'string' || gettype($contentValue) == 'integer' || gettype($contentValue) == 'double') {
                $contentValue = '' . $contentValue;
                $itemIdentifier = strtolower(str_replace(' ', '', $contentValue));
            } elseif ($contentValue->tagName == 'span') {
                $itemIdentifier = strtolower(str_replace(' ', '', $contentValue->nodeValue));
            }

            // Set text wrapper
            $gridTextWrapper = $this->getFormFactory()->buildHtmlElement('span', $contentValue, '', 'DataTableTextWrapper');

            // Set item style
            $gridTextWrapper->appendAttr('style', 'max-width:100%;width:100%;box-sizing:border-box;');

            // Create grid cell with given text
            $gridCell = $this->getFormFactory()->buildHtmlElement('div', $gridTextWrapper, '', 'DataTableCell');
            $gridRow->append($gridCell);

            // Set header (if any)
            if ($header && !empty($itemIdentifier)) {
                // Set identifier
                $gridCell->data('column-name', $itemIdentifier);

                // Add sorting icon
                $sortingIcon = $this->getFormFactory()->buildHtmlElement('div', '', '', 'sortingIcon');
                $gridTextWrapper->append($sortingIcon);
            }

            // Set grid item width
            if (empty($this->columnRatios)) {
                $ratio = (!$this->checkable ? 100 : 100 - 8);
                $w = $ratio / $this->hSize;
            } else {
                $w = $this->columnRatios[$key];
            }
            $gridCell->attr('style', 'width:' . $w . '%;');
        }

        // Append grid row to grid list and return the DOMElement
        $this->gridList->append($gridRow);

        return $gridRow;
    }
private function appendSimpleRow ( $ contents , $ class = '' , $ header = false ) { // Check width size if ( $ this -> hSize == 0 ) { throw new LogicException ( 'There are no headers set on the datatable yet.' ) ; } // Create grid row object $ gridRow = $ this -> getFormFactory ( ) -> buildHtmlElement ( 'li' , '' , '' , ( $ class == '' ? 'DataTableRow' : $ class ) ) ; // Trim contents to the column size if ( $ this -> hSize < count ( $ contents ) ) { array_slice ( $ contents , $ this -> hSize ) ; } // Add extra columns $ contentsCount = count ( $ contents ) ; for ( $ i = 0 ; $ i < $ this -> hSize - $ contentsCount ; $ i ++ ) { $ contents [ ] = $ this -> getFormFactory ( ) -> buildHtmlElement ( 'span' ) ; } // Insert contents to row foreach ( $ contents as $ key => $ contentValue ) { // Create item identifier $ itemIdentifier = '' ; if ( gettype ( $ key ) == 'string' ) { $ itemIdentifier = strtolower ( str_replace ( ' ' , '' , $ key ) ) ; } elseif ( gettype ( $ contentValue ) == 'string' || gettype ( $ contentValue ) == 'integer' || gettype ( $ contentValue ) == 'double' ) { $ contentValue = '' . $ contentValue ; $ itemIdentifier = strtolower ( str_replace ( ' ' , '' , $ contentValue ) ) ; } elseif ( $ contentValue -> tagName == 'span' ) { $ itemIdentifier = strtolower ( str_replace ( ' ' , '' , $ contentValue -> nodeValue ) ) ; } // Set text wrapper $ gridTextWrapper = $ this -> getFormFactory ( ) -> buildHtmlElement ( 'span' , $ contentValue , '' , 'DataTableTextWrapper' ) ; // Set item style $ gridTextWrapper -> appendAttr ( 'style' , 'max-width:100%;width:100%;box-sizing:border-box;' ) ; // Create grid cell with given text $ gridCell = $ this -> getFormFactory ( ) -> buildHtmlElement ( 'div' , $ gridTextWrapper , '' , 'DataTableCell' ) ; $ gridRow -> append ( $ gridCell ) ; // Set header (if any) if ( $ header && ! empty ( $ itemIdentifier ) ) { // Set identifier $ gridCell -> data ( 'column-name' , $ itemIdentifier ) ; // Add sorting icon $ sortingIcon = $ this -> getFormFactory ( ) -> buildHtmlElement ( 'div' , '' , '' , 'sortingIcon' ) ; $ gridTextWrapper -> append ( $ sortingIcon ) ; } // Set grid item width if ( empty ( $ this -> columnRatios ) ) { $ ratio = ( ! $ this -> checkable ? 100 : 100 - 8 ) ; $ w = $ ratio / $ this -> hSize ; } else { $ w = $ this -> columnRatios [ $ key ] ; } $ gridCell -> attr ( 'style' , 'width:' . $ w . '%;' ) ; } // Append grid row to grid list and return the DOMElement $ this -> gridList -> append ( $ gridRow ) ; return $ gridRow ; }
Assistant function in inserting a row into the dataGridList

@param array  $contents Array with text or HTMLElements
@param string $class    Extra classes for styling specific rows (used for header)
@param bool   $header   Whether this row is the header of the list.

@return HTMLElement
@throws Exception
@throws InvalidArgumentException
@throws LogicException
Assistant function in inserting a row into the dataGridList