class HDBView
Attributes
oid[R]
Public Class Methods
new(moduleName: nil, modelName: nil, filter: "true", sortField: "id", sortDirection: "asc", pageSize: '5', page: 0, paginationView: true, filterView: true, actionMenu: true, actionButtons: true, poid: nil, **args)
click to toggle source
Calls superclass method
HDivTag::new
# File lib/hwidgets/hdbview.rb, line 5 def initialize(moduleName: nil, modelName: nil, filter: "true", sortField: "id", sortDirection: "asc", pageSize: '5', page: 0, paginationView: true, filterView: true, actionMenu: true, actionButtons: true, poid: nil, **args) @moduleName = moduleName @modelName = modelName @oid = hm().malloc(self, poid).obj.object_id.to_s @pageSize = pageSize @page = page @paginationView = paginationView @filterView = filterView @actionMenu = actionMenu @dbTableView = HDBTableView.new(moduleName: moduleName, modelName: modelName, filter: filter, sortField: sortField, sortDirection: sortDirection, pageSize: pageSize, page: page, poid: @oid) HDBTableView.tableViewDecorator(@dbTableView) super(class: 'hdbview', id: @oid, **args) self.hotLog("hdbview oid: #{@oid}".hight_purple) self.actionButtons() if actionButtons self.dropDowns() if actionMenu self << HDBFilterView.new(sourceView: @dbTableView) if filterView self << HPagination.new(sourceView: @dbTableView, pages: @dbTableView.rpcPages, pageSize: pageSize, rowsForPage: [@pageSize, 10, 100, 'all']) if paginationView self << @dbTableView return self end
Public Instance Methods
actionButtons()
click to toggle source
# File lib/hwidgets/hdbview.rb, line 48 def actionButtons actionBtns = hv().viewByType(@moduleName, @modelName, :table).xpath("//actionbuttons") actionBtns.each do |button| nodes = button.xpath(".//button") buttons = nodes.to_a_of_h self << HDBActionButtons.new(sourceView: @dbTableView, buttons: buttons) if buttons.any? end end
dropDowns()
click to toggle source
# File lib/hwidgets/hdbview.rb, line 37 def dropDowns actionMenus = hv().viewByType(@moduleName, @modelName, :table).xpath("//actionmenu") actionMenus.each do |menu| nodes = menu.xpath(".//item") items = nodes.to_a_of_h self << HDropDown.new(sourceView: @dbTableView, caption: menu["name"], items: items) if items.any? end end
html()
click to toggle source
Calls superclass method
HWidget#html
# File lib/hwidgets/hdbview.rb, line 59 def html return super end