src/Ubiquity/controllers/admin/viewers/ModelViewer.php
public function getModelDataTable($instances, $model, $totalCount, $page = 1) {
		$adminRoute = $this->controller->_getBaseRoute ();
		$files = $this->controller->_getFiles ();
		$dataTable = $this->getDataTableInstance ( $instances, $model, $totalCount, $page );
		$attributes = $this->controller->_getAdminData ()->getFieldNames ( $model );
		$this->setDataTableAttributes ( $dataTable, $attributes, $model, $instances );
		$dataTable->setCaptions ( $this->getCaptions ( $attributes, $model ) );

		$dataTable->addClass ( "small very compact" );
		$lbl = new HtmlLabel ( "search-query", "<span id='search-query-content'></span>" );
		$icon = $lbl->addIcon ( "delete", false );
		$lbl->wrap ( "<span>", "</span>" );
		$lbl->setProperty ( "style", "display: none;" );
		$icon->getOnClick ( $adminRoute . $files->getRouteRefreshTable (), "#lv", [ "jqueryDone" => "replaceWith","hasLoader" => "internal" ] );

		$dataTable->addItemInToolbar ( $lbl );
		$dataTable->addSearchInToolbar ();
		$dataTable->setToolbarPosition ( PositionInTable::FOOTER );
		$dataTable->getToolbar ()->setSecondary ();
		return $dataTable;
	}
public function getModelDataTable($instances, $model, $totalCount, $page = 1) {
		$adminRoute = $this->controller->_getBaseRoute ();
		$files = $this->controller->_getFiles ();
		$dataTable = $this->getDataTableInstance ( $instances, $model, $totalCount, $page );
		$attributes = $this->controller->_getAdminData ()->getFieldNames ( $model );
		$this->setDataTableAttributes ( $dataTable, $attributes, $model, $instances );
		$dataTable->setCaptions ( $this->getCaptions ( $attributes, $model ) );

		$dataTable->addClass ( "small very compact" );
		$lbl = new HtmlLabel ( "search-query", "<span id='search-query-content'></span>" );
		$icon = $lbl->addIcon ( "delete", false );
		$lbl->wrap ( "<span>", "</span>" );
		$lbl->setProperty ( "style", "display: none;" );
		$icon->getOnClick ( $adminRoute . $files->getRouteRefreshTable (), "#lv", [ "jqueryDone" => "replaceWith","hasLoader" => "internal" ] );

		$dataTable->addItemInToolbar ( $lbl );
		$dataTable->addSearchInToolbar ();
		$dataTable->setToolbarPosition ( PositionInTable::FOOTER );
		$dataTable->getToolbar ()->setSecondary ();
		return $dataTable;
	}
public function getModelDataTable ( $ instances , $ model , $ totalCount , $ page = 1 ) { $ adminRoute = $ this -> controller -> _getBaseRoute ( ) ; $ files = $ this -> controller -> _getFiles ( ) ; $ dataTable = $ this -> getDataTableInstance ( $ instances , $ model , $ totalCount , $ page ) ; $ attributes = $ this -> controller -> _getAdminData ( ) -> getFieldNames ( $ model ) ; $ this -> setDataTableAttributes ( $ dataTable , $ attributes , $ model , $ instances ) ; $ dataTable -> setCaptions ( $ this -> getCaptions ( $ attributes , $ model ) ) ; $ dataTable -> addClass ( "small very compact" ) ; $ lbl = new HtmlLabel ( "search-query" , "<span id='search-query-content'></span>" ) ; $ icon = $ lbl -> addIcon ( "delete" , false ) ; $ lbl -> wrap ( "<span>" , "</span>" ) ; $ lbl -> setProperty ( "style" , "display: none;" ) ; $ icon -> getOnClick ( $ adminRoute . $ files -> getRouteRefreshTable ( ) , "#lv" , [ "jqueryDone" => "replaceWith" , "hasLoader" => "internal" ] ) ; $ dataTable -> addItemInToolbar ( $ lbl ) ; $ dataTable -> addSearchInToolbar ( ) ; $ dataTable -> setToolbarPosition ( PositionInTable :: FOOTER ) ; $ dataTable -> getToolbar ( ) -> setSecondary ( ) ; return $ dataTable ; }
Returns the dataTable responsible for displaying instances of the model

@param array $instances objects to display
@param string $model model class name (long name)
@return DataTable
Returns the dataTable responsible for displaying instances of the model