Multiple list views in symfony admin generator

Posted by skr on 2010-03-22 in symfony,, admin

To replace a lot of separate lists with an symfony admin module with its great filtering capabilities, I need a way to configure multiple list views. The user should be able to select from preconfigured lists and to hide columns before printing or copying the table to a spreadsheet.

I've tried the great jQuery columnmanager, but it only hides the colums for printing - if I copy the table to the spreadsheet application, all columns are copied....

Configuration:

  list:
    #standard view, 
    display: [aufn_nr, vorname, name, bearbeiter, bearbdatum]
    layout:
      list2:
        label: Mit Adresse und aktueller Kostenzusage
        display: [aufn_nr, name, adress, _status, more_columns]
      foto: 
        display: [aufn_nr, name, vorname, foto]

User Interface:

The available layouts are user selectable and stored (like filter vars). With a simple button click the table is transferred to the clipboard.

Layout1 Layout2

Internals:

I've changed the symfony sfGenerator class, so that it duplicates _list_t[hd]_layout.php for every layout, so on runtime only one view is included.

 <?php foreach ($this->configuration->getValue('list.'.$this->configuration->currentLayout.'.display') as $name => $field): 
 <?php echo $this->addCredentialCondition(sprintf(<<<EOF
 <td class="sf_admin_%s sf_admin_list_td_%s">
   [?php echo %s ?]
</td>
 
 EOF
, strtolower($field->getType()), $name, $this->renderField($field)), $field->getConfig()) ?>
<?php endforeach; ?>

One comment so far

Posted by jp_morvan on 2010-03-22
Hi, Can you post a print screen to see ?