tag:blogger.com,1999:blog-3069322399391810784.post3168949353032840845..comments2023-09-15T00:45:32.976-07:00Comments on SAKRA WebStudio: Sort By Foreign Key or Custom Column in Symfony Admin GeneratorLaszlo Doboshttp://www.blogger.com/profile/13169306714360180327noreply@blogger.comBlogger5125tag:blogger.com,1999:blog-3069322399391810784.post-55682782039003087012011-12-29T11:39:32.017-08:002011-12-29T11:39:32.017-08:00oh... haven't noticed the comment of Eduardo :...oh... haven't noticed the comment of Eduardo :) nevermind :)Alex Filatovhttps://www.blogger.com/profile/15248557510343626466noreply@blogger.comtag:blogger.com,1999:blog-3069322399391810784.post-43126167368164922502011-12-29T10:00:51.306-08:002011-12-29T10:00:51.306-08:00I think you also should override this:
action.cla...I think you also should override this:<br /><br />action.class.php:<br /><br /> protected function isValidSortColumn($column)<br /> {<br /> return Doctrine_Core::getTable('Video')->hasColumn($column);<br /> }<br /><br />in the template:<br />generator/sfDoctrineModule/THEME_NAME/parts/sortingAction.php<br /><br />to return `true` in case of "virtual" columnsAlex Filatovhttps://www.blogger.com/profile/15248557510343626466noreply@blogger.comtag:blogger.com,1999:blog-3069322399391810784.post-80350349034806301442011-12-01T12:10:34.971-08:002011-12-01T12:10:34.971-08:00Wow, that's true, I've absolutely forgot i...Wow, that's true, I've absolutely forgot it. Thank you so much!Laszlo Doboshttps://www.blogger.com/profile/13169306714360180327noreply@blogger.comtag:blogger.com,1999:blog-3069322399391810784.post-75993394582729087132011-11-30T05:14:38.273-08:002011-11-30T05:14:38.273-08:00Great post man! But you must override the isValidS...Great post man! But you must override the isValidSortColumn method, otherwise the value will not be recorded in the session.<br /><br />Something like:<br /> protected function isValidSortColumn($column)<br /> {<br /> return array_key_exists($column, $this->varHolder->get('configuration')->getFieldsDefault());<br /> }Eduardo Marcolinohttps://www.blogger.com/profile/15856547197470413715noreply@blogger.comtag:blogger.com,1999:blog-3069322399391810784.post-29913273736064944522011-02-17T02:18:15.900-08:002011-02-17T02:18:15.900-08:00It's unbelievable! Thanks a lot!It's unbelievable! Thanks a lot!Gáborhttps://www.blogger.com/profile/08756148103007529405noreply@blogger.com