Problem implementing KoolPHPSuite
Permalink
I am trying to get an example single page going to learn how to implement the KoolPHPSuite controls for my applications. Everything is working great when I set up a standalone test page (outside of concrete5), however, when I create the single page under concrete5, it doesn't render correctly and I get the javascript error:
Webpage error details
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; InfoPath.2; OfficeLiveConnector.1.4; OfficeLivePatch.1.3)
Timestamp: Wed, 10 Mar 2010 13:55:14 UTC
Message: 'KoolUpdatePanel' is undefined
Line: 102
Char: 1
Code: 0
URI:http://localhost/concrete5/index.php/example2/...
The code for the example single page is:
I have placed the folder containing the KoolPHPSuite in the single_pages folder. I originally tried to add that folder in the libraries directory, but realized that when the controls are implemented, they require references to the directory structure, so decided it was easier just to put the KoolPHPSuite in the single_pages directory.
Any help is greatly appreciated.
Thanks,
Adam
Webpage error details
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; InfoPath.2; OfficeLiveConnector.1.4; OfficeLivePatch.1.3)
Timestamp: Wed, 10 Mar 2010 13:55:14 UTC
Message: 'KoolUpdatePanel' is undefined
Line: 102
Char: 1
Code: 0
URI:http://localhost/concrete5/index.php/example2/...
The code for the example single page is:
<?php require "KoolControls/KoolAjax/koolajax.php"; //KoolGrid requires KoolAjax to make ajax call. require "KoolControls/KoolGrid/koolgrid.php"; $koolajax->scriptFolder = "KoolControls/KoolAjax";//Set script folder //Create database connection $db_con = mysql_connect("localhost","root","pass"); mysql_select_db("concrete5",$db_con); // Create DataSource $ds = new MySQLDataSource($db_con); $ds->SelectCommand = "select customerNumber,customerName,phone,city from koolphpsuite_customers"; //Initiate Grid $grid = new KoolGrid("grid"); $grid->scriptFolder = "KoolControls/KoolGrid";//Set script folder $grid->DataSource = $ds; $grid->AjaxEnabled = true;
Viewing 15 lines of 25 lines. View entire code block.
I have placed the folder containing the KoolPHPSuite in the single_pages folder. I originally tried to add that folder in the libraries directory, but realized that when the controls are implemented, they require references to the directory structure, so decided it was easier just to put the KoolPHPSuite in the single_pages directory.
Any help is greatly appreciated.
Thanks,
Adam
don't use require in concrete,
stick that KoolControls folder in /tools
then use this instead of the require
$tl = Loader::tool('KoolControls/KoolAjax/koolajax');
i also suggest you use the built in c5 function for the db, also put the defined c5 or die at the top
stick that KoolControls folder in /tools
then use this instead of the require
$tl = Loader::tool('KoolControls/KoolAjax/koolajax');
i also suggest you use the built in c5 function for the db, also put the defined c5 or die at the top
Hi Mnkras,
Could you give an example of how to use Loader::tool? How would I go about referencing the directory in the code below:
Thanks,
Adam
Could you give an example of how to use Loader::tool? How would I go about referencing the directory in the code below:
$koolajax->scriptFolder = "KoolControls/KoolAjax";//Set script folder
Thanks,
Adam
Hi oneil1,
Thanks for the suggestion, but doesn't help my grid load correctly, and, it messes up the images that load on the home page. Would you happen to have any other ideas?
Thanks,
Adam
Thanks for the suggestion, but doesn't help my grid load correctly, and, it messes up the images that load on the home page. Would you happen to have any other ideas?
Thanks,
Adam
1. Don't use jQuery? Don't load it!