I have a problem to reference the KoolControls folder relatively.
Here is my my folder tree:
I want to reference the KoolControls folder from my view/actors/index.php file
Here is my code:
<?php
/*
* Please put this file in the same folder with KoolControls folder
* or you may modify path of require and scriptFolder to refer correctly
* to koolgrid.php and its folder.
*/
require(dirname(__DIR__).'/common/KoolControls/KoolGrid/koolgrid.php');
require(dirname(__DIR__).'/common/KoolControls/KoolAjax/koolajax.php');
$koolajax->scriptFolder = dirname(__DIR__)."/common/KoolControls/KoolAjax";
$ds = new ArrayDataSource($actors);
$grid = new KoolGrid("grid");
$grid->scriptFolder = dirname(__DIR__)."/common/KoolControls/KoolGrid";
$grid->DataSource = $ds;
$grid->styleFolder = dirname(__DIR__)."/common/KoolControls/KoolGrid/styles/default";
$grid->Width = "655px";
$grid->Height = "300px";
$grid->PageSize = 25;
$grid->AjaxEnabled = true;
$grid->KeepRowStateOnRefresh = true;
$grid->AllowScrolling = true;
$column = new GridBoundColumn();
$column->DataField = "first_name";
$column->HeaderText = "Vorname";
$column->Width = "45%";
$grid->MasterTable->AddColumn($column);
$column = new GridBoundColumn();
$column->DataField = "last_name";
$column->HeaderText = "Nachname";
$column->Width = "45%";
$grid->MasterTable->AddColumn($column);
$column = new GridBoundColumn();
$column->DataField = "actor_id";
$column->HeaderText = "ID";
$column->Width = "10%";
$grid->MasterTable->AddColumn($column);
$grid->MasterTable->AllowHovering = true;
$grid->MasterTable->VirtualScrolling = true;
$grid->MasterTable->AllowSelecting = true;
$grid->MasterTable->AutoGenerateColumns = false;
$grid->MasterTable->AutoGenerateDeleteColumn = false;
$grid->MasterTable->AutoGenerateExpandColumn = false;
$grid->MasterTable->Width = "655px";
$grid->MasterTable->RowAlternative = true;
$grid->MasterTable->Pager = new GridPrevNextAndNumericPager();
$grid->Process();
?>
<form id="form1" method="post"> <!-- You should render the grid inside a form tag, in case $grid->AjaxEnabled = false the grid needs a form to operate. -->
<?php echo $koolajax->Render();?>
<?php echo $grid->Render();?>
</form>
and this is what i get, somehow a lot of functionality is not applied:
and this is how it should look like:
Actually I am not sure, if the code has other problems - it seems AJAX is not working, the pager does not work nor the theme is applied....???
Any suggestions?
Thanks in advance.