Page 1 of 1

[Solved] fieldgroup options in delegate class ?

PostPosted: Mon Nov 16, 2009 3:49 am
by silma
Hello,

I'm looking for a way to collapse (or not) one of my fieldgroup depending on some value.

Is there a function "myfieldgroup__collapsed" like there is a "myfield__default" one ?


Thanks a lot for you help.

PostPosted: Mon Nov 16, 2009 4:36 pm
by shannah
You could do this inside the init() method of the delegate class I suppose.

eg.

Code: Select all
function init(&$table){
    $fieldgroup =& $table->getFieldGroup('mygroup');
    $record =& Dataface_Application::getInstance()->getRecord();
    if ( $record->val("foo") == 'bar' ){
        $fieldgroup['collapsed'] = 1;
    }
}


PostPosted: Wed Nov 18, 2009 3:00 am
by silma
That works perfectly well.

Thanks a lot !