Constructor: [data [cellAttr [headerRows [headerAttr [makeCellIds [makeRowIds]]]]]
Note that constructor arguments are identical to those for Table
data – matrix of data to display in the table
cellAttr – Cell Attributes
headerRows – # of header rows
headerAttr – Header attributes
makeCellIds – 1 to generate IDs <td id="tableId_r2c3">
makeRowIds – 1 to generate Row IDs <tr id="tableId_row2">
Public Fields:
Data – matrix of data to display in the table
CellAttr – Cell Attributes
HeaderRows – # of header rows
HeaderAttr – Header attributes
MakeCellIds – 1 to generate IDs <td id="tableId_r2c3">
MakeRowIds – 1 to generate Row IDs <tr id="tableId_row2"> Warning: this ids are generated, but if you need them in order to provide meaningful tools for interaction with the table, it is recommended to use DataTable's features instead which may be more useful!
Width – (string) width of the table
InitFilterWith – initalize "Search"-field with this string
FocusFilter – put initial focus on Filter-Control (boolean, default=0)
Bootstrap – integer (use Boostrap-styling. 0=no, 1 or 4=BS4, 3=BS3)
PlugIns – comma delimited list of "official" plugins to use
currently supported plugins are: yadcf (yet another datatable column filter) – needs to be explicitely referenced mark (highlight search results) - setting option "mark" to true is sufficient, does not need to be specified in "Plugin" then responsive (responsive layout) - setting option "responsive" to true is sufficient buttons -provides options to copy data to Excel, print and toggle columns NB: this mechanism currently supports a subset of Datatable's plugins/extensions. Please let us know (miserver@dyalog.com) if your favourite Plugin is missing!
Relevant Sample Pages:
:Class WidgetDoc : MiPageSample
:include #.MS3SiteUtils
∇ Compose;ns;widget;ref;wref;src;chunk;files;r;split;find
:Access public
Add _.style'#view {display: none}'
r←'<div class="WidgetDoc">'
(ns widget)←Get'namespace widget'
:If 9.1=#.⎕NC⊂ns
ref←#.⍎ns
:If 9=ref.⎕NC widget
wref←ref⍎widget
r,←'<h3 id="WidgetDocTitle">'
:If 0=wref.⎕NC⊂'DocBase'
:OrIf 0∊⍴wref.DocBase ⍝
r,←ns,'.',widget
:Else ⍝
r,←(ns,'.',widget)External wref.DocBase
:EndIf
src←1↓⎕SRC wref
src↓⍨←+/∧\''∘≡¨src
src←#.Strings.dlb¨src
src←src/⍨∧\'⍝'=⊃¨src
src←'¶ +'⎕R' '⊢'¶',¨1↓¨src
src←{1↓¨⍵⊂⍨'¶'=⍵}∊src
src←HtmlSafeText¨#.Strings.dlb¨src
:If 0∊⍴src
r,←'<h3 class="red">No documentation found.</h3>'
:Else
:For chunk :In src
⍝
⍝
⍝
⍝
⍝
⍝
:If ∨/'::'⍷chunk ⍝
:If ∨/find←' - '⍷chunk
split←find⍳1
r,←'<h3>',(chunk↑⍨split-1),'</h3>'
chunk←chunk↓⍨split+2
find←'- '⍷chunk
split←find⍳1
r,←'<p'
:If '-'≠⊃chunk~' '
r,←' class="hang"'
:EndIf
r,←'>',(chunk↑⍨split-1),'–',(split↓chunk),'</p>'
:Else
r,←'<h3>',chunk,'</h3>'
:EndIf
:ElseIf ∨/find←'- '⍷chunk
split←find⍳1
r,←'<p'
:If '-'≠⊃chunk~' '
r,←' class="hang"'
:EndIf
r,←'>',(chunk↑⍨split-1),'–',(split↓chunk),'</p>'
:Else ⍝
find←'⍝'⍷chunk
split←6+find⍳1
r,←'<p class="hang"><code>',(split↑chunk),'</code>',(split↓chunk),'</p>'
:EndIf
:EndFor
:EndIf
files←'relevant'ForControl widget
:If 0∊⍴files
r,←'<h3 class="red">No relevant sample pages found.</h3>'
:Else
r,←'<h3>Relevant Sample Pages:</h3>'
(files←'#samples'New _.Tabs(↓⍉↑{DescrEmbed ⍵}¨files)).Theme←'FF8C00'
r,←files.Render
:EndIf
:Else
r,←'<h3 class="red">Widget "',widget,'" not found in namespace ',ns,'.</h3>'
:EndIf
:Else
r,←'<h3 class="red">Namespace "',ns,'" not found.</h3>'
:EndIf
r,←'</div>'
Add'<h3>Description::' '::'⎕R'' ':'⊢r
∇
:EndClass