PhpGrid With cakephp

QuestionsPhpGrid With cakephp
Usama asked 10 years ago

I want to integrate PhpGrid in my Cakephp Application.I am assuming that the integration will not have any problem.
Perhaps if someone has any experience please do share.

3 Answers
Abu Ghufran answered 10 years ago

Integration should go smooth. It does not utilize cakephp data layer classes.
Just split the grid code in 2 parts. php in controller function and html in view. And pass $out to view.

From faq:

Q) How can i integrate PHPGrid in MVC based frameworks like Yii, Codeignitor, Zend Framework, CakePHP and others.

To integrate in MVC, You can divide code in 2 sections. And put first in controller and pass the $out variable to view, where you can render it with rest of JS/CSS files.

CONTROLLER PART

include("inc/jqgrid_dist.php");
$g = new jqgrid();

$out = $g->render("list1");

VIEW PART

<html>

<link rel="stylesheet" type="text/css" media="screen" href="js/themes/redmond/jquery-ui.custom.css"></link>
<link rel="stylesheet" type="text/css" media="screen" href="js/jqgrid/css/ui.jqgrid.css"></link>

<script src="js/jquery.min.js" type="text/javascript"></script>
<script src="js/jqgrid/js/i18n/grid.locale-en.js" type="text/javascript"></script>
<script src="js/jqgrid/js/jquery.jqGrid.min.js" type="text/javascript"></script>
<script src="js/themes/jquery-ui.custom.min.js" type="text/javascript"></script>

<div style="margin:10px">
<?php echo $out?>
</div>

Anand answered 5 years ago

If it is working means anyone please share the controller and ctp(view) code. because when i integrate phpgrid and cakephp 3.7 it will generate the errors in jqgrid_dist.php (undefined variable and many things) please share full code here.

View post on imgur.com

Abu Ghufran Staff answered 5 years ago

You can try after disabling notices in cakephp:

https://stackoverflow.com/a/20697964/385377

Unfortunately, the core lib of data grid is written on older version of php and may show notices, but hiding them won’t do anything harmful.

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Your Answer

2 + 20 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?