Data Table Component - Maple Help

Home : Support : Online Help : Programming : Document Tools : Components : Data Table Component

DocumentTools[Components]

 DataTable
 generate XML for a DataTable Component

 Calling Sequence DataTable( opts )

Parameters

 opts - (optional); one or more keyword options as described below

Options

 • action : string; A string which parses to one or more valid statements in 1-D Maple Notation.
 • identity : {name,string}; The reference name of the component.
 • columnheader : truefalse; Specifies whether column names will be shown. The default is false.
 • columnnames : list({scalar,string}); A list of headers for each column.
 • columnwidths : list(posint); A list of positive integers specifying the width in pixels of the columns.
 • enabled : truefalse; Specifies whether the component is enabled. The default is true. If enabled is false then an inserted DataTable will not receive updates when the associated Matrix or Vector changes.
 • editable : truefalse; Specifies whether component entries can be edited. The default is true.
 • rowheader : truefalse; Show the row names. The default is true.
 • rownames : list({scalar,string}); A list of headers for each row.
 • tooltip : string; The text that appears when the mouse pointer hovers over the DataTable.
 • variable : name; The name of the associated Matrix or Array.
 • visible : truefalse; Specifies whether the component is visible. The default is true.
 • visiblerows : posint; The number of rows that are displayed.
 • visiblecolumns : posint; The number of columns that are displayed.

Description

 • The DataTable command in the Component Constructors package returns an XML function call which represents a DataTable Component.
 • The generated XML can be used with the results of commands in the Layout Constructors package to create an entire Worksheet or Document in XML form. Such a representation of a Worksheet or Document can be inserted into the current document using the InsertContent command.

Examples

 > $\mathrm{with}\left(\mathrm{DocumentTools}:-\mathrm{Components}\right):$
 > $\mathrm{with}\left(\mathrm{DocumentTools}:-\mathrm{Layout}\right):$
 > $M≔\mathrm{Matrix}\left(3,3,\left[\left[1,3,2.7\right],\left[5,\mathrm{\pi },\mathrm{sin}\left(x\right)\right],\left[a,b,\frac{1.0}{3}\right]\right]\right)$
 $\left[\begin{array}{ccc}1& 3& 2.7\\ 5& \mathrm{π}& \mathrm{sin}{}\left(x\right)\\ a& b& 0.3333333333\end{array}\right]$ (1)

Executing the DataTable command produces a function call.

 > $\mathrm{DT}≔\mathrm{DataTable}\left(\mathrm{identity}="DataTable0",\mathrm{variable}='M'\right)$
 ${\mathrm{DT}}{≔}{\mathrm{_XML_EC-RTableBrowser}}{}\left({"id"}{=}{"DataTable0"}{,}{"columnheader"}{=}{"false"}{,}{"editable"}{=}{"true"}{,}{"enabled"}{=}{"true"}{,}{"handle"}{=}{"36893628725147119732"}{,}{"rowheader"}{=}{"false"}{,}{"variable"}{=}{"M"}{,}{"visible"}{=}{"true"}{,}{"visiblecolumns"}{=}{"3"}{,}{"visiblerows"}{=}{"3"}\right)$ (2)

By using commands from the DocumentTools:-Layout package a nested function call can be produced which represents a worksheet.

 > $\mathrm{xml}≔\mathrm{Worksheet}\left(\mathrm{Group}\left(\mathrm{Input}\left(\mathrm{Textfield}\left(\mathrm{DT}\right)\right)\right)\right):$

That XML representation of a worksheet can be inserted directly.

 > $\mathrm{DocumentTools}:-\mathrm{InsertContent}\left(\mathrm{xml}\right):$

 > $\mathrm{DT}≔\mathrm{DataTable}\left(\mathrm{identity}="DataTable0",\mathrm{variable}='M',\mathrm{rowheader},\mathrm{columnheader},\mathrm{columnnames}=\left[A,"Col. B",3\right],\mathrm{columnwidths}=\left[25,50,100\right],\mathrm{rownames}=\left[x,y,z\right],\mathrm{tooltip}="my data table"\right):$
 > $\mathrm{xml}≔\mathrm{Worksheet}\left(\mathrm{Group}\left(\mathrm{Input}\left(\mathrm{Textfield}\left(\mathrm{DT}\right)\right)\right)\right):$
 > $\mathrm{DocumentTools}:-\mathrm{InsertContent}\left(\mathrm{xml}\right):$

The action code associated with the Data Table Component may be viewed or edited by selecting the Data Table and clicking Edit Content Changed Code in the Content Panel. If the enabled property of the DataTable Component is set then that action code is executed whenever its entries are changed manually. Note that assigning to an entry of the associated Vector/Matrix/Array will not cause execution of the action code.

Compatibility

 • The DocumentTools[Components][DataTable] command was introduced in Maple 2015.