Get KoolPHP UI with 30% OFF!

Martin
The columns and their headers are not aligned. It happens when I use column fields with a custom value map. I did not test if it happens also for column fields without the custom value map. Here is a working code shwing the problem. The code is using the sample database table "payments":
<html><body>
<?php
/* Bug:
 *
 *  - Column Headers not aligned with their values
*/
$KoolControlsFolder = "../classes/KoolControls";
require_once($KoolControlsFolder."/KoolAjax/koolajax.php");
$koolajax->scriptFolder = $KoolControlsFolder."/KoolAjax";
require $KoolControlsFolder."/KoolPivotTable/koolpivottable.php";
class MyValueMap implements PivotIValueMap
{
	function map($_value)
	{
		return array("YEAR" => substr($_value, 0, 4) );
	}
	function getMapFields()
	{
		return array("YEAR");
	}
}
/// MAIN
$db = mysql_connect("localhost", "root", "root");
mysql_select_db("kooltest");
$ds = new MySQLPivotDataSource($db);
$ds->select("customerNumber, paymentDate, amount")->from("payments");
$pivot = new KoolPivotTable("pivot");
$pivot->scriptFolder = $KoolControlsFolder."/KoolPivotTable";
$pivot->styleFolder = "office2007";
$pivot->DataSource = $ds;
$pivot->AjaxEnabled = true;
$pivot->Width = "1400px";
$pivot->HorizontalScrolling = true;
$pivot->Height = "800px";
$pivot->HorizontalScrolling = true;
$pivot->AllowFiltering = true;
$pivot->AllowSorting = true;
$pivot->AllowSortingData = true;
$pivot->AllowReorder = true;
$pivot->AllowCaching = true;
$pivot->ShowGrandColumn = false;
$pivot->ShowStatus = true;
$pivot->Appearance->RowHeaderMinWidth = "200px";
//Use the Prev and Next Numneric Pager
$pivot->Pager = new PivotPrevNextAndNumericPager();
$pivot->Pager->PageSize = 20;
//DATA FIELD
$field = new PivotSumField("amount");
$field->Text = "AMOUNT";
$field->FormatString = "{n}";
$field->AllowReorder = false;
$field->AllowFiltering = false;
$pivot->AddDataField($field);
$pivot->SetDataFieldForSorting($field);
// COLUMN FIELD
$field = new PivotField("paymentDate");
$field->setValueMap(new MyValueMap());
$field->AllowReorder = false;
$pivot->AddColumnField($field);
// ROW FIELD
$field = new PivotField("customerNumber");
$field->Text = "CUSTOMER CODE";
$field->AllowReorder = false;
$pivot->AddRowField($field);
$pivot->Process();
?>
<form id="form1" method="post">
	<?php echo $koolajax->Render();?>
	
	<div style="padding-top:10px;">
		<?php echo $pivot->Render();?>
	</div>
</form>
</body></html>
Posted Oct 2, 2015 Kool
Peter
Please try to add the<head></head> into your <html>. Let us know if it works.
If it does not, please include also the screenshoot, we would like to see it.
Posted Oct 3, 2015 , edited Oct 3, 2015 Kool
Martin
Hi Peter. It did not help:
<html>
<head></head>
<body>
<?php
$KoolControlsFolder = "../classes/KoolControls";
require_once($KoolControlsFolder."/KoolAjax/koolajax.php");
$koolajax->scriptFolder = $KoolControlsFolder."/KoolAjax";
require $KoolControlsFolder."/KoolPivotTable/koolpivottable.php";
....

Result is the same. Columns are not aligned with their headers. Unfortunately, I do not know how to submit a screenshot. The control "Add Image" does not work for me in the Web Browser I'm using (IE 11). You can run the code if you change the DB credentials and the path to the Kool PHP lib.
Posted Oct 5, 2015 Kool