Class: Glib::JsonUi::ViewBuilder::Panels::BulkEdit2

Inherits:
View show all
Defined in:
app/helpers/glib/json_ui/view_builder/panels.rb

Instance Attribute Summary

Attributes inherited from JsonUiElement

#json, #page

Instance Method Summary collapse

Methods inherited from View

component_name

Methods inherited from JsonUiElement

action, any, array, badgeable, bool, color, component_name, date, date_time, enum, float, hash, icon, #initialize, int, length, menu, panels_builder, #props, required, singleton_array, string, text, url, views

Constructor Details

This class inherits a constructor from Glib::JsonUi::JsonUiElement

Instance Method Details

#createdObject

Override



500
501
502
503
504
505
506
507
508
509
510
511
# File 'app/helpers/glib/json_ui/view_builder/panels.rb', line 500

def created
  # bulkEdit2 is a form PEER, not a form child: it answers the same
  # forms_submit action a form does (forms/directSubmit) and submits its
  # rows itself to `import.submitUrl`. Inside a form, its repeated
  # per-row input names would collide with the form's FormData scans
  # (duplicate-name warnings, dirty-baseline pollution) while adding
  # nothing to the form's submission -- so, like a nested form, reject
  # the arrangement at render time.
  if page.current_form
    raise 'panels_bulkEdit2 is not allowed inside a form; place it as a sibling and target it with forms_submit targetId'
  end
end

#dataRows(value) ⇒ Object



540
541
542
# File 'app/helpers/glib/json_ui/view_builder/panels.rb', line 540

def dataRows(value)
  json.dataRows value
end

#viewCells(values) ⇒ Object

Experimental panels_builder :accessory, :header, :footer



532
533
534
535
536
537
538
# File 'app/helpers/glib/json_ui/view_builder/panels.rb', line 532

def viewCells(values)
  json.set! 'viewCells' do
    values.each do |value|
      value.call(page.view_builder)
    end
  end
end

#viewRows(value) ⇒ Object



544
545
546
# File 'app/helpers/glib/json_ui/view_builder/panels.rb', line 544

def viewRows(value)
  json.viewRows value
end