示例#1
0
 /**
  * Render
  * 
  * Renders a cell and populates
  * it's rendered value
  * 
  * @access	public
  * @param	Spark\Grid_Column_Cell	Cell
  * @return	Spark\Grid_Column_Renderer_Checkbox
  */
 public function render(\Grid_Column_Cell $cell)
 {
     // Get the value
     $value = $cell->get_original_value();
     // An array of checked items
     $checked = ($checked = $cell->get_column()->get_checked() and $checked->count()) ? $checked->get_data() : array();
     $cell->set_rendered_value(\Form::checkbox($this->get_checkbox_name($cell), $value, array(in_array($value, $checked) ? 'checked' : null)));
     return $this;
 }
示例#2
0
 /**
  * Render
  * 
  * Renders a cell and populates
  * it's rendered value
  * 
  * @access	public
  * @param	Spark\Grid_Column_Cell	Cell
  * @return	Spark\Grid_Column_Renderer_Options
  */
 public function render(\Grid_Column_Cell $cell)
 {
     // Get options
     $options = $cell->get_column()->get_options();
     // Value fallback
     $value = '';
     // Override the value with an option
     if (isset($options[$cell->get_original_value()])) {
         $value = $options[$cell->get_original_value()];
     }
     $cell->set_rendered_value($value);
     return $this;
 }
示例#3
0
 /**
  * Render
  * 
  * Renders a cell and populates
  * it's rendered value
  * 
  * @access	public
  * @param	Spark\Grid_Column_Cell	Cell
  * @return	Spark\Grid_Column_Renderer_Options
  */
 public function render(\Grid_Column_Cell $cell)
 {
     // Get current row from database
     $results = $cell->get_driver()->get_results()->as_array();
     $current = $results[$this->counter++];
     // Get options
     $options = $cell->get_column()->get_options();
     // Value fallback
     $value = '';
     // Override the value with an option
     if (isset($options[$cell->get_original_value()])) {
         $value = $options[$cell->get_original_value()];
         // Create date tooltip
         if ($cell->get_original_value() == 2) {
             $value .= '<a href="#" class="activeDate" id="activeDate02" title="' . date('m/d/Y', $current->active_from) . ' - ' . date('m/d/Y', $current->active_to) . '">' . \Theme::instance()->asset->img('icon-calendar.png', array('width' => 16, 'height' => 16, 'alt' => '')) . '</a>';
         }
     }
     $cell->set_rendered_value($value);
     return $this;
 }