Method: WidgetList::List.get_group_by_selection

Defined in:
lib/widget_list.rb

.get_group_by_selection(list_parms) ⇒ Object



2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
# File 'lib/widget_list.rb', line 2321

def self.get_group_by_selection(list_parms)
  groupBy = ''

  if $_REQUEST.key?('switch_grouping')
    groupBy = $_REQUEST['switch_grouping']
    $_SESSION.deep_merge!({'CURRENT_GROUPING' => { list_parms['name'] => groupBy} })
  elsif $_SESSION.key?('CURRENT_GROUPING') && !$_SESSION['CURRENT_GROUPING'].nil? && $_SESSION['CURRENT_GROUPING'].key?(list_parms['name'])
    groupBy = $_SESSION['CURRENT_GROUPING'][list_parms['name']]
    list_parms['groupBySelected'] =  groupBy
  else
    groupBy = ''
  end

  return groupBy
end