original_string: public function init_expander($field)
      {
          // set column style
          $this->columns[$field]['thparam'] .= ' style="width:40px; text-align:center"';
  
          // set column refid - referenced model table for example
          if (!isset($this->columns[$field]['refid'])) {
              if ($this->model) {
                  $refid = $this->model->table;
              } elseif ($this->dq) {
                  $refid = $this->dq->args['table'];
              } else {
                  $refid = preg_replace('/.*_/', '', $this->app->page);
              }
  
              $this->columns[$field]['refid'] = $refid;
          }
  
          // initialize button widget on page load
          $class = $this->name.'_'.$field.'_expander';
          $this->js(true)->find('.'.$class)->button();
  
          // initialize expander
          $this->js(true)
              ->_selector('.'.$class)
              ->_load('ui.atk4_expander')
              ->atk4_expander();
      }
code: public function init_expander($field)
      {
          // set column style
          $this->columns[$field]['thparam'] .= ' style="width:40px; text-align:center"';
  
          // set column refid - referenced model table for example
          if (!isset($this->columns[$field]['refid'])) {
              if ($this->model) {
                  $refid = $this->model->table;
              } elseif ($this->dq) {
                  $refid = $this->dq->args['table'];
              } else {
                  $refid = preg_replace('/.*_/', '', $this->app->page);
              }
  
              $this->columns[$field]['refid'] = $refid;
          }
  
          // initialize button widget on page load
          $class = $this->name.'_'.$field.'_expander';
          $this->js(true)->find('.'.$class)->button();
  
          // initialize expander
          $this->js(true)
              ->_selector('.'.$class)
              ->_load('ui.atk4_expander')
              ->atk4_expander();
      }
code_tokens: public function init_expander ( $ field ) { // set column style $ this -> columns [ $ field ] [ 'thparam' ] .= ' style="width:40px; text-align:center"' ; // set column refid - referenced model table for example if ( ! isset ( $ this -> columns [ $ field ] [ 'refid' ] ) ) { if ( $ this -> model ) { $ refid = $ this -> model -> table ; } elseif ( $ this -> dq ) { $ refid = $ this -> dq -> args [ 'table' ] ; } else { $ refid = preg_replace ( '/.*_/' , '' , $ this -> app -> page ) ; } $ this -> columns [ $ field ] [ 'refid' ] = $ refid ; } // initialize button widget on page load $ class = $ this -> name . '_' . $ field . '_expander' ; $ this -> js ( true ) -> find ( '.' . $ class ) -> button ( ) ; // initialize expander $ this -> js ( true ) -> _selector ( '.' . $ class ) -> _load ( 'ui.atk4_expander' ) -> atk4_expander ( ) ; }
docstring: Initialize expander.
  
  @param string $field field name
docstring_tokens: Initialize expander .