%3 ::xo::Table::TABLE::BulkAction ::xo::Table::TABLE::BulkAction render render-data ::xo::Drawable ::xo::Drawable _ render_localizer ::xo::Table::TABLE::BulkAction->::xo::Drawable ::xo::Table::TABLE::Action ::xo::Table::TABLE::Action render ::xo::Table::TABLE::Action->::xo::Drawable ::xo::Table::TABLE::Field ::xo::Table::TABLE::Field get_orderby render render-data renderSortLabels ::xo::Table::TABLE::Field->::xo::Drawable ::xo::Table::Line ::xo::Table::Line attlist ::xo::Table::Line->::xo::Drawable ::xo::Table::TABLE ::xo::Table::TABLE init_renderer render render-actions render-body render-bulkactions ::xo::Table::TABLE->::xo::Drawable ::xo::tdom::AttributeManager ::xo::tdom::AttributeManager ::xo::Drawable->::xo::tdom::AttributeManager ::xo::Table::TABLE2 ::xo::Table::TABLE2 render render-actions ::xo::Table::TABLE2->::xo::Table::TABLE ::xo::Table::TABLE3 ::xo::Table::TABLE3 init_renderer ::xo::Table::TABLE3->::xo::Table::TABLE2

Class ::xo::Table::TABLE

::xo::Table::TABLE[i] create ...

Class Relations

  • class: ::xotcl::Class[i]
  • superclass: ::xo::Drawable[i]
  • subclass: ::xo::Table::TABLE2[i]
::xotcl::Class create ::xo::Table::TABLE \
     -superclass ::xo::Drawable

Methods (to be applied on instances)

  • init_renderer (scripted)

    #:log "--"
    set :__rowcount 0
    set :css.table-class list
    set :css.tr.even-class list-even
    set :css.tr.odd-class list-odd
  • render (scripted)

    if {![nsf::is object [self]::__actions]} {:actions {}}
    if {![nsf::is object [self]::__bulkactions]} {:bulkactions {}}
    set bulkactions [[self]::__bulkactions children]
    if {[llength $bulkactions] == 0} {
      html::table -class ${:css.table-class} {
        :render-actions
        :render-body
      }
    } else {
      set name [[self]::__bulkactions set __identifier]
      html::form -name $name -method POST {
        html::table -class ${:css.table-class} {
          :render-actions
          :render-body
        }
        :render-bulkactions
      }
    }
  • render-actions (scripted)

    html::tr -class list-button-bar  {
      set cols [llength [[self]::__columns children]]
      html::td -colspan $cols -class list-button-bar {
        set children [[self]::__actions children]
        set last [lindex $children end]
        foreach o $children {
          $o render
          if {$o ne $last} {
            html::t -disableOutputEscaping "·"
          }
        }
      }
    }
  • render-body (scripted)

    html::thead {
      html::tr -class list-header {
        foreach o [[self]::__columns children] {
          $o render
        }
      }
    }
    set children [:children]
    if {[llength $children] == 0} {
      html::tr {html::td { html::t ${:no_data}}}
    } else {
      html::tbody {
        foreach line [:children] {
          #:log "--LINE vars=[:info vars] cL: [[self class] info vars] r=[:renderer]"
          html::tr -class [expr {[incr :__rowcount]%2 ? ${:css.tr.odd-class} : ${:css.tr.even-class}}] {
            foreach field [[self]::__columns children] {
              if {[$field istype HiddenField]} continue
              if {![$field exists CSSclass]} {
                # TODO: remove me when message does not show up
                ns_log warning "CSSclass missing $field\n[$field serialize]"
                $field set CSSclass ""
              }
              set CSSclass [list "list" {*}[$field CSSclass]]
              html::td [concat [list class $CSSclass] [$field html]] {
                $field render-data $line
              }
            }
          }
        }
      }
    }
  • render-bulkactions (scripted)

    set bulkactions [[self]::__bulkactions children]
    html::div -class "list-button-bar-bottom" {
      html::t "#xotcl-core.Bulk_actions#:"
      set bulkaction_container [[lindex $bulkactions 0] set __parent]
      set name [$bulkaction_container set __identifier]
    
      html::ul -class compact {
        foreach ba $bulkactions {
          set id [::xowiki::Includelet html_id $ba]
          html::li {
            html::a -title [$ba tooltip] -id $id -class button -href #  {
                  html::t [$ba label]
                }
          }
          set script [subst {
            acs_ListBulkActionClick("$name","[$ba url]");
          }]
          if {[$ba confirm_message] ne ""} {
            set script [subst {
              if (confirm('[$ba confirm_message]')) {
                $script
              }
            }]
          }
          template::add_event_listener  -id $id  -preventdefault=false  -script $script
        }
      }
    }