Method: WidgetList::List.build_list
- Defined in:
- lib/widget_list.rb
.build_list(list_parms) ⇒ Object
build_list controls a default AJAX/Export and full HTML return output in some cases you should copy and paste this logic for custom scenarios in your controller, but in most cases, this is okay
3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 |
# File 'lib/widget_list.rb', line 3214 def self.build_list(list_parms) list = WidgetList::List.new(list_parms) ret = {} # # If AJAX, send back JSON # if $_REQUEST.key?('BUTTON_VALUE') && $_REQUEST['LIST_NAME'] == list_parms['name'] if $_REQUEST.key?('export_widget_list') return ['export',list.render()] end if $_REQUEST['list_action'] != 'ajax_widgetlist_checks' ret['list'] = list.render() ret['search_bar'] = list.get_header_pieces['searchBar'] ret['group_by_items'] = list.get_header_pieces['groupByItems'] ret['export_button'] = list.get_header_pieces['exportButton'] ret['list_id'] = list_parms['name'] ret['callback'] = 'ListSearchAheadResponse' end return ['json',WidgetList::Utils::json_encode(ret)] else # # Else assign to variable for view # if list. return list.render() else if .key?(:api_mode) && [:api_mode] ret['list'] = list.render() return ['json',WidgetList::Utils::json_encode(ret)] else return ['html', list.render() ] end end end end |