I've not used KoolPHP or KoolGrid - however:
1) The grid itself (and rendering thereof) is probably best suited to
living in a view, not a controller. The controller manages application flow
and business logic, not presentation.
2) Yes, its a vendor thing, it belongs in the Vendor folder (the PHP that
is, the javascript will have to go in the webroot or else the browser will
never be able to get access to it). If you plan to reuse it in cakephp it
might be handy to wrap it up in a component and/or helper to do the heavy
lifting for you so that you can use it in a more cakephp way..
3) You shouldn't *ever* use the query method. I have yet to really ever see
a valid use for this method. Even complex joins and so forth where it might
be easier to use query can be got around by using a proper find() call.
Query is nasty.

KoolGrid seems to have an array data adapter, which may be able to be
pressed into service (accepts an associative array, I'm assuming it returns
JSON to the grid... CakePHP returns associative arrays..I'd try and
investigate down these lines).

where does your "form" markup live? please tell me its not in a controller?
You should also really be using the form helper to build a form....

As an alternative, I use the following for grids in my apps:
http://trirand.com/blog/jqgrid/jqgrid.html

Its pure javascript (there is no PHP thing behind it that you have to use)
and you can map json objects to the grid quite easilly - build a nice REST
api that returns the data in an appropriate format to the grid and then do
all of the grid logic in javascript inside of the view. It is a very large
grid control and has a tonne of features - it is theme compatable with
JQueryUI which is also quite handy.





On Wed, Nov 14, 2012 at 8:16 AM, Russell Brown <r...@russsoftware.com>wrote:

> Anyone have good documentation or examples about how to use the KoolPHP
> controls with CakePHP 2.X?
>
> I have figured some very minor things out:
>
> 1) How to load in Controller:
>
> App::import('Vendor', 'KoolControls/KoolGrid/koolgrid');
>
> $Koolgrid = new koolgrid($_il6n);
>
> 2) Copy KoolControls folder to the Vendor folder
> 3) How to use SQL commands directly in CakePHP:
> $this->Post->query("select id,user_id,title,body from posts");
>
> Post = Model name
> Posts = Table name
>
> But haven't been able to get any further than this.
>
> KoolPHP documentation for the KoolGrid shows using this but it doesn't
> work:
>
>      $grid = new KoolGrid("grid");
>       $grid->scriptFolder = "Vendor/KoolControls/KoolGrid";
>       $grid->styleFolder="default";
>       $grid->DataSource = $ds;
>       $grid->Width = "655px";
>       $grid->RowAlternative = true;
>       $grid->AutoGenerateColumns = true;
>       $grid->MasterTable->Pager = new GridPrevNextAndNumericPager();
>
>       $grid->Process();
> ?>
>
> <form id="form1" method="post">
>       <?php $grid->Render();?>
> </form>
>
>  --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com.
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.


Reply via email to