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:
<?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;


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

 
oneil1 replied on at Permalink Reply
oneil1
It is the first I am learning about KoolPHPSuite, but try disabling the standard javascript plugins and give it a try. See instructions here:http://www.concrete5.org/help/building_with_concrete5/developers/tu...

1. Don't use jQuery? Don't load it!
Mnkras replied on at Permalink Reply
Mnkras
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
adilger replied on at Permalink Reply
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:

$koolajax->scriptFolder = "KoolControls/KoolAjax";//Set script folder


Thanks,
Adam
adilger replied on at Permalink Reply
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