Changes between Version 13 and Version 14 of AjaxList


Ignore:
Timestamp:
2010-09-02T17:57:51Z (14 years ago)
Author:
Serge Okon
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • AjaxList

    v13 v14  
    2828==== Instantiation ====
    2929There is usually a single list per controller in cakePHP. The first step should be to include the ajax List component into your controller, but declaring a $components variable, inside the controller class.
    30 {{
     30{{{
    3131var $components = array('AjaxList');
    3232}}}
    33 If the $components variable already exists, just add the ajax list to the array
     33If the $components variable already exists, just add the ajax list to the array:
     34{{{
    3435var $components = array('ExistingComponenet1', 'AjaxList', 'ExistingComponenet2');
     36}}}
     37Next, add your model to the $uses array, in the same fashion as the components above:
     38var $uses = array('EvaluationRubric',
     39
     40Next, create the following functions in the controller:
     41{{{
     42// Sets up the data for the ajax list
     43function setUpAjaxList () {
     44
     45   // Which columns to list, and include data from.
     46   $columns = array();
     47   // The available actions for each column
     48   $actions = array();
     49   // Any extra filtering to perform on the data from the database.
     50   $extraFilters = "";
     51   // Any tables to join in, and any extra filters to implement on those tables
     52   $joinTables = "";
     53   // Whether to fetch associated data or not ( (-1) means not at all ).
     54   $recursive = (-1);
     55
     56  $this->AjaxList->setUp($this->, $columns, $actions,
     57            "Group.group_num", "Group.group_name",
     58            $joinTables, $extraFilters, $recursive, "postProcess");
     59}
     60}}}
     61
     62
    3563
    3664==== Columns ====