Skip to content
Fattening up your cakephp
PHP
Failed to load latest commit information.
Config/Schema
Controller/Component Somehow $this->Time was not initialized? May 12, 2015
Model CS fixes Apr 23, 2013
Vendor CS fixes Apr 23, 2013
View/Helper
.gitignore
LICENSE Remove whitespace [Gun.io WhitespaceBot] Oct 21, 2011
README

README

Cholesterol Plugin Version 0.1
------------------------------

This plugin currently only contains jqGrid components and helper.

Requirement
-----------

jQuery + UI (tested on 1.7.2) - http://jquery.com/
jqGrid (tested on version 3.5.3) - http://www.trirand.com/blog/?page_id=6

Tested with cakephp 1.3. May work with 1.2.5.

Demo of this plugin is currently available in http://chavik.com/cholesterolized
The demo source code can be found in http://github.com/rchavik/cholestorized

For the impatient, use the following example as a starting point:

<?php
// controllers/users_controller.php
class UsersController extends AppController {
	// add Jqgrid component and helpers in your class variables.
	var $components = array('Cholesterol.Jqgrid');
	var $helpers = array('Cholesterol.Jqgrid');

	// controllers/users_controller.php - action that displays the grid
	function list_users() {
	}

	// Retrieve data for the grid in Json format
	function get_list_users() {
		// Perform the actual query using JqgridComponent and prepare
		// the JSON response for the grid.
		$this->Jqgrid->find('User');
	}
?>

<?php
// views/users/list_users.ctp
echo $jqgrid->grid('user');

// Minimal configuration required to setup jqgrid initialization
// The format of $options array follows jqgrid configuration
// NOTE: javascript blocks (eg: for event handling) needs to be enclosed
// with <script> and </script>
// If anyone has better solution for this, please let me know
echo $jqgrid->script('user', array(
	'url' => '/users/get_list_users.json',
	'loadComplete' => '
<script>
function() {
        alert("Your grid has been loaded successfully");
}
</script>
'
	)
);

?>

Note: I still consider this plugin as very unstable.

Good luck and have fun.
-- rchavik
Something went wrong with that request. Please try again.