Quantcast
Channel:
Viewing all articles
Browse latest Browse all 4235

SS_Datetime in GridField - Header text not applied and click-to-sort changes to search

$
0
0

Not sure if either of these two things is a bug, or can be explained with configuration. But both only seem to apply to DateFields displayed in a GridView. The second might apply to the presence of empty rows of data (for that column)

Problem 1 - Using $summary_fields to set custom header text works, but not for DateFields.

In my DataObject for the grid, I have this:

private static $db = array(
      'SessionStart' => 'SS_Datetime',
      'SessionEnd' => 'SS_Datetime'      
   );
   
   private static $has_one = array(
      'CMSAdminUser' => 'Member',
      'AnotherObject' => 'MyObject'   
   );   

private static $summary_fields = array(
      'CMSAdminUser.FirstName' => 'This header text appears on the GridFeild',
      'AnotherObject.Title' => 'So does this header text',
      'SessionStart' => 'The header for this is "Session Start" no matter what',
      'SessionEnd' => 'And this one is always "Session End"'
   );

The titles I have in $summary_fields array values should explain the issue. Any ideas? Tried dev/build, ?flush=all etc. In fact I've tested that I can change the other two fields and the two SS_Datetime fields are ignored. Data in the GridField cells is fine though.

Problem 2 - GridField loads with SS_Datetime headers as 'Sortable', but after the first 'click to sort', header changes to a search

It's worth noting that this only happens with the SessionEnd data, and some of the rows for this column are empty. The SessionStart column is always populated and doesn't exhibit the same. Might be best explained with screen shots:

On load:

After first click sort on "Session End" header:

Note that also the "Session End" header text completely disappears after the click. Never to return.


Posted to: SS_Datetime in GridField - Header text not applied and click-to-sort changes to search | Show Thread | Post Reply


Viewing all articles
Browse latest Browse all 4235

Trending Articles