Class: HDBActionButtons

Inherits:
HDivTag show all
Defined in:
lib/hwidgets/hdbactionbuttons.rb

Instance Attribute Summary

Attributes inherited from HWidget

#tag

Instance Method Summary collapse

Methods inherited from HWidget

#_addJsSlot, #_set, #_setStyle, #addJsFunction, #appendChild, #appendChilds, #buildSignature, #closeTag, #connect, #copyConstructor, #get, #getChilds, #getElementBy, #getSystemProperty, #hotLog, #openTag, #replacePlaceholder, #reset, #set, #setChilds, #setCloseTag, #setClosedTag, #setEnablePlaceholder, #setInnerHTML, #setParent, #setPlaceholder, #setPlaceholders, #setProperties, #setSlots, #setStyle, #setStyles, #setSystemProperties, #setSystemProperty, #setTag, #storeSlots, #storeStyle, #strProperties, test, #unset, widgetSpace

Constructor Details

#initialize(sourceView: nil, buttons: [], **args) ⇒ HDBActionButtons

Returns a new instance of HDBActionButtons.



3
4
5
6
7
8
9
# File 'lib/hwidgets/hdbactionbuttons.rb', line 3

def initialize(sourceView: nil, buttons: [], **args)

  @sourceView = sourceView
  @buttons = buttons

  return super(class: 'hdbactionbuttons', **args)
end

Instance Method Details

#htmlObject



12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/hwidgets/hdbactionbuttons.rb', line 12

def html
 
  @buttons.each do |button|
    action = button.delete(:action)
    button = HWidget.new("button", button.delete(:name), class: "actionbutton", **button) 
    button.connect(:onclick, @sourceView, "rpcAction", args: {action: action}, 
                 id: @sourceView.oid, mode: 'none',
                 attributes: ":hdbTableView.ids(obj) => ids")
    self << button
  end
  
  return super
end