This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use Stack Overflow.

sfWidgetFormJQueryAutocompleter and value_callback

Forum to discuss ExtJS and other JS plugins

sfWidgetFormJQueryAutocompleter and value_callback

by jessejr » Thu Feb 19, 2009 4:23 am

Please, can somebody give me a sample about how to use parameter value_callback in sfWidgetFormJQueryAutocompleter ?
jessejr
Junior Member
 
Posts: 3
Joined: Sat Aug 02, 2008 3:15 pm

Re: sfWidgetFormJQueryAutocompleter and value_callback

by dirkpostma » Sun Mar 29, 2009 1:27 pm

I'd like to have that too. I'm new to Symfony and I can't find an API on sfWidgetFormJQueryAutocompleter. Does it exist? Especially a description of the possible config parameters and an explanation or example of how to use value_callback. Thanks!
dirkpostma
Junior Member
 
Posts: 19
Joined: Thu Mar 26, 2009 2:12 am
Location: Amsterdam, NL

Re: sfWidgetFormJQueryAutocompleter and value_callback

by jessejr » Thu Apr 02, 2009 2:27 am

Here the example:

in the form lib/form/doctrine/XXXForm.class.php
Code: Select all
 public function configure()
  {
   // widgets
    $this->widgetSchema['midia_id'] = new sfWidgetFormJQueryAutocompleter(array(
        'url'    =>   sfContext::getInstance()->getController()->genUrl('@ajax_getMidia'),
        'value_callback'   =>  array('Midia', 'MidiaSearch'),));   
  }


in the lib/model/doctrine/Midia.class.php
Code: Select all
  public static function midiaSearch($a) {
     $result = Doctrine::getTable('Midia')->find($a);
    return $result ? $result->getMidia() : null;
  }
jessejr
Junior Member
 
Posts: 3
Joined: Sat Aug 02, 2008 3:15 pm