- Methods: All Methods Documented Methods Hide Methods
- Source: Display Source Hide Source
- Variables: Show Variables Hide Variables
Class ::xo::Table::YUIDataTableRenderer
::xo::Table::YUIDataTableRenderer create ...
Defined in
Class Relations
::xotcl::Class create ::xo::Table::YUIDataTableRenderer \ -superclass ::xo::Table::TABLE3Methods (to be applied on instances)
render_yui_js (scripted, private)
<instance of xo::Table::YUIDataTableRenderer> render_yui_jsGenerates the JavaScript fragment, that is put below and (progressively enhances) the HTML table.
- Testcases:
- No testcase defined.
set container ${:id}_container set datasource ${:id}_datasource set datatable ${:id}_datatable set coldef ${:id}_coldef set finaljs "" set js "var $datasource = new YAHOO.util.DataSource(YAHOO.util.Dom.get('${:id}')); \n" append js "$datasource.responseType = YAHOO.util.DataSource.TYPE_HTMLTABLE; \n" append js "$datasource.responseSchema = \{ \n" append js " fields: \[ \n" set js_fields [list] foreach field [[self]::__columns children] { if {[$field hide]} continue lappend js_fields " \{ key: \"[$field set name]\" \}" } append js [join $js_fields ", "] " \] \n\};\n" append js "var $coldef = \[\n" set js_fields [list] foreach field [[self]::__columns children] { if {[$field hide]} continue if {[$field istype HiddenField]} continue if {[$field istype BulkAction]} { set subid [::xowiki::Includelet html_id $field] set label "<input type='checkbox' id='$subid'></input>" if {[info exists ::__csrf_token]} { append label "<input type='hidden' name='__csrf_token' value='$::__csrf_token'>" } set sortable false append finaljs [subst { document.getElementById('$subid').addEventListener('click', function (event) { acs_ListCheckAll('objects', this.checked); }, false); }] } else { set label [lang::util::localize [$field label]] set sortable [expr {[$field exists sortable] ? [$field set sortable] : true}] } lappend js_fields " \{ key: \"[$field set name]\" , sortable: $sortable, label: \"$label\" \}" } append js [join $js_fields ", "] "\];\n" append js "var $datatable = new YAHOO.widget.DataTable('$container', $coldef, $datasource);\n" append js $finaljs return $jsVariables
::xo::Table::YUIDataTableRenderer set __default_metaclass ::xotcl::Class ::xo::Table::YUIDataTableRenderer set __default_superclass ::xotcl::Object
- Methods: All Methods Documented Methods Hide Methods
- Source: Display Source Hide Source
- Variables: Show Variables Hide Variables