Thanks. This link also helped me too.
http://snipt.net/Tram/symfony-12-add-a-custom-filter-field-for-generated-admin/ Att, Pedro Casado On Tue, Dec 8, 2009 at 9:12 AM, Pedro Casado <[email protected]> wrote: > Im using Propel. > > Is the same name? i'll look for addXXXColumnQuery.. > > Att, > Pedro Casado > > > > On Tue, Dec 8, 2009 at 8:01 AM, Joel Cuevas <[email protected]> wrote: > >> I'm guessing, so try it and let us know. In your filter class add >> this: >> >> public function addDescriptionTypeIdColumnQuery(Doctrine_Query $query, >> $field, $value) >> { >> $query->leftJoin('r.DescriptionType d')->andWhereIn('d.id', $value); >> } >> >> Note the name of the method (it includes the camel-cased name of the >> column), the leftJoin and the andWhereIn. I'm supossing that $values >> is an array with the selected values, but I'm not nearly sure. In >> other scenarios, $value holds the value, text or number, of the filter >> widget. >> >> Written on the fly. Typos potentially included. :) >> >> On Dec 8, 1:07 am, Pedro Casado <[email protected]> wrote: >> > how did you fix it ? >> > i got the same problem. >> > >> > thanks >> > >> > Att, >> > Pedro Casado >> > >> > On Thu, Aug 6, 2009 at 7:23 PM, Nei Rauni Santos <[email protected]> >> wrote: >> > >> > >> > >> > > Guys, >> > >> > > I'm trying to change a field to use multiple choose select on my admin >> > > generator module. >> > >> > > For to do it I follow these steps. >> > >> > > I've changed the formfilter class on generate.yml like this >> > >> > > filter: >> > > class: BackendHotelDescriptionFormFilter >> > >> > > than, I create this class extending the Base class. >> > >> > > <code> >> > > class BaseHotelDescriptionFormFilter extends BaseFormFilterDoctrine >> > > { >> > > public function setup() >> > > { >> > > $this->setWidgets(array( >> > > 'description_type_id' => new sfWidgetFormDoctrineChoice(array >> > > ('model' => 'DescriptionType', 'add_empty' => true)), >> > > 'hotel_id' => new sfWidgetFormDoctrineChoice(array >> > > ('model' => 'Hotel', 'add_empty' => true)), >> > > )); >> > > </code> >> > >> > > on my extend class I changed the widget to add the attribute multiple >> > > choose like this >> > >> > > <code> >> > > class BackendHotelDescriptionFormFilter extends >> > > BaseHotelDescriptionFormFilter >> > > { >> > > public function configure() >> > > { >> > > $widgets = $this->getWidgetSchema(); >> > > $validators = $this->getValidatorSchema(); >> > >> > > $widgets['description_type_id']->setAttribute('multiple', true ); >> > > </code> >> > >> > > It's work until here..The problem is when I select more than one field >> > > and post form, I use the latest selected option.. >> > >> > > Is it the best way? how can I do it? >> > >> > > Here's my schema. >> > >> > > HotelDescription: >> > > tableName: hotel_description >> > > actAs: >> > > I18n: >> > > fields: [description] >> > > actAs: >> > > Timestampable: ~ >> > > columns: >> > > description_type_id: { type: integer(10), notnull: true } >> > > hotel_id: { type: integer(10), notnull: true } >> > > description: { type: string, notnull: true } >> > > relations: >> > > DescriptionType: >> > > local: description_type_id >> > > foreign: id >> > > type: one >> > > Hotel: >> > > local: hotel_id >> > > foreign: id >> > > type: one >> > >> > > DescriptionType: >> > > tableName: description_type >> > > actAs: >> > > I18n: >> > > fields: [name] >> > > actAs: >> > > Timestampable: ~ >> > > columns: >> > > id: { type: integer(10), primary: true } >> > > name: { type: string(100), notnull: true } >> > >> > > Regards, >> > >> > > Nei >> > >> > > --~--~---------~--~----~------------~-------~--~----~ >> > > You received this message because you are subscribed to the Google >> Groups >> > > "symfony users" group. >> > > To post to this group, send email to [email protected] >> > > To unsubscribe from this group, send email to >> > > [email protected]<symfony-users%[email protected]> >> <symfony-users%[email protected]<symfony-users%[email protected]> >> > >> > > For more options, visit this group at >> > >http://groups.google.com/group/symfony-users?hl=en >> > > -~----------~----~----~----~------~----~------~--~--- >> >> -- >> >> You received this message because you are subscribed to the Google Groups >> "symfony users" group. >> To post to this group, send email to [email protected]. >> To unsubscribe from this group, send email to >> [email protected]<symfony-users%[email protected]> >> . >> For more options, visit this group at >> http://groups.google.com/group/symfony-users?hl=en. >> >> >> > -- You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en.
