Thanks for porting this to D7, great module!

The only thing I would like to see is to have the default field's checked by default. Currently if I want to remove one field from display or whatever, I have to select them all on, minus the one.

Cheers.

Comments

well mannered squirrel’s picture

I would be interested in this too.

Actually, on my site when a user first visits the view page, there is an error because all fields are dynamic fields and exposed and by default no dynamic field checkboxes are selected thus nothing is displayed. (My dynamic fields are exposed together with other filters)

I find it odd because the other filters default to "all" when no checkboxes are selected, however the dynamic fields default to "nothing" hence an empty view.

Similarly, if I enable the "reset" button in my view, when resetting all the dynamic fields become unchecked and the view displays nothing. :(

Is there a hook I can use to create a small module to default the dynamic fields form items to "checked" or something like that ?

donSchoe’s picture

Category: Feature request » Bug report
Issue summary: View changes
Status: Active » Needs work

It's a bug. Just looked through the code,

      '#default_value' => $field_names_defaults,
      '#options' => $all_fields,

It's already implemented but not working. But I can't see why.

Both, the options and the default values are arrays with correct key->value pairs. Maybe this is a wrong API implementation but the documation does not say how checkboxes default values should look like.

Related: http://drupal.stackexchange.com/q/112906/13526

  • Commit 26912bc on 7.x-1.x by donSchoe:
    Add debug symbols for mysterious issue #1245838
    
donSchoe’s picture

A workaround is to enable the sortability, see #935910: Enable sortability of displayed fields.
This will display default checked fields correctly.

donSchoe’s picture

Status: Needs work » Fixed

Sortability is default behaviour now and can not be disabled. (It's a feature! :D)

donSchoe’s picture

Assigned: Unassigned » donSchoe

  • Commit 26e6a0a on 7.x-1.x by donSchoe:
    Issue #1245838 by donSchoe: Fix default fields are checked initially
    

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

delacosta456’s picture

hi

this is old but i would like to suggest or inform that default shouldn't be check in som case.

Why ?

sometime we may have multiple expose filter . and we all know that Drupal only have one Apply button for expose filter.
So if the table was preconfigured to be cleaner (less display of column) , when the user click apply to filter the table will now be refresh with all all columns displays which may/is not what was expwcted