# A3DPDFScrollTableData

struct `A3DPDFScrollTableData`

  Structure to define a ScrollTable widget.

  The frame of the scroll table is defined with a grid using parameters `m_iGridNbRows`, `m_iGridNbCols`, `m_iGridHeightCells`, `m_piGridWidthCells`.

  The table header must be defined outside of this function if the layout requires one.

  Rich text can be specified in a scroll table. This allows you to apply styling information to portions of the text, such as bold or italic. To do this, the boolean `A3DPDFTextFieldData::m_bAllowRichText`must be set to TRUE in m_pCellFormat. If m_pCellFormat specifies rich text formatting, then ALL the texts in the table bound to this scrollbar MUST BE defined as rich texts, that is to say they need to be formatted as in the following example:

      <spanstyle="font-family:Helvetica;font-size:12pt;font-weight:bold;">Boldtext</span>

  Text fields first take the format specified in `m_pCellFormat`, then attributes might be overloaded with the rich text formatting. For example, “text-align” specified in xml style attribute overrides the alignment specified in `m_eTextAlignment`.

  A scroll table must be bound to a data table with a map that has the same size of the number of columns: the parameter piMapColumns in `A3DPDFScrollTableBindToTable()`should be equal to `m_iGridNbCols`.

  The content of scroll table columns can be texts, images, or checkboxes. The column types must be set with `m_peColumnTypes`.

  For columns of type `kA3DPDFImageContent`, the data table must contain an icon id, such as returned by the function `A3DPDFDocumentAddImageAsIcon2()`.

  For columns of type `kA3DPDFCheckBoxContent`, the data is generally not set at initialization, but modified at runtime by the user reading the PDF file. The runtime values can be retrieved by a javascript function defined on the document object:

      getScrollTableDataForCheckedRows(scrolltableuuid,idxcolcheckboxinscrolltable)

  where

  - scrolltableuuid is the scrolltable unique id, it can be retrieved with the API `A3DPDFWidgetGetName()`
  - idxcolcheckboxinscrolltable is the index of column to be checked in the scrolltable
  - The function returns a table object with an extract from the data table of the checked rows. This table object has members: nbrows, nbcols, and data.

  For example, a javascript code could be as follows to get all values for the first column of rows with a checked checkbox:

      //(pcSTName:returnedbyA3DPDFWidgetGetName)
      //(idxColCheckBox:indexofcolumnwithcheckboxesinthescrolltable)
      vartablecheckedrows=this.getScrollTableDataForCheckedRows('"'+pcSTName+'","'+to_string(idxColCheckBox)+'"');
      for(i=0;i<tablecheckedrows.nbrows;i++)
      rowscheckedforcol0.push(tablecheckedrows.data[i][0]);

  Also for a column of type `kA3DPDFCheckBoxContent`, the function `A3DPDFCheckBoxSetForCheckAllColumn()`can be used to associate a ‘check/uncheck all’ functionnality with an additional CheckBox, created separately. This checkbox is automatically unchecked as soon as the user checks a check box in the associated column. Also, it might be useful for a better user experience to uncheck all data column when the associated process is terminated. For this, a javascript function is defined on the document object:

      uncheckAllScrollTableData(scrolltableuuid,idxcolcheckboxinscrolltable)

  where

  - scrolltableuuid is the scrolltable unique id, it can be retrieved with the API `A3DPDFWidgetGetName()`
  - idxcolcheckboxinscrolltable is the index of column to be unchecked in the scrolltable

  On the same way, a javascript function is defined on the document object to enable/disable the checkboxes. This function is typically called during execution of a customer process to disable the checkboxes.

      enableScrollTableCheckBoxes(scrolltableuuid,idxcolcheckboxinscrolltable,enable)

  where

  - scrolltableuuid is the scrolltable unique id, it can be retrieved with the API `A3DPDFWidgetGetName()`
  - idxcolcheckboxinscrolltable is the index of column to be enabled/disabled in the scrolltable
  - enable is a boolean, which must be ‘true’ to enable all checkboxes of the specified column, and ‘false’ to disable all checkboxes

  Returns

  > A3D_SUCCESS in case of success or an error code

  ## Index

  Variables

  - `m_iGridNbRows`
  - `m_iGridNbCols`
  - `m_iGridHeightCells`
  - `m_piGridWidthCells`
  - `m_iSliderWidth`
  - `m_pCellFormat`
  - `m_pHighlightColor`
  - `m_peColumnTypes`

Variables

A3DInt32 `A3DPDFScrollTableData.``m_iGridNbRows`
  `A3DInt32`

  The number of rows in the frame.

A3DInt32 `A3DPDFScrollTableData.``m_iGridNbCols`
  `A3DInt32`

  The number of columns in the frame.

A3DInt32 `A3DPDFScrollTableData.``m_iGridHeightCells`
  `A3DInt32`

  The height of cells in the frame.

A3DInt32 *`A3DPDFScrollTableData.``m_piGridWidthCells`
  `A3DInt32`*

  Array of the widths of the cells.

  The array must be of size m_iGridNbCols.

A3DInt32 `A3DPDFScrollTableData.``m_iSliderWidth`
  `A3DInt32`

  The width of the scroll bar (in points).

  Important: The scrollbar is positioned on the right of the table, outside of the frame. Specify 0 to not have a scroll bar.

A3DPDFTextFieldData *`A3DPDFScrollTableData.``m_pCellFormat`
  `A3DPDFTextFieldData`*

  Optional.

  Defines the text field format for scroll table cells. If NULL, default format is used (black centered Arial text of font size 10, on white background).

A3DPDFRgbColorData *`A3DPDFScrollTableData.``m_pHighlightColor`
  `A3DPDFRgbColorData`*

  Optional.

  Color to highlight a row. If NULL, default color is used (same color as Acrobat fields highlighting).

A3DPDFEColumnType *`A3DPDFScrollTableData.``m_peColumnTypes`
  `A3DPDFEColumnType`*

  Array of the types of the cells.

  The array must be of size m_iGridNbCols. If NULL, all cells are of `kA3DPDFTextContent`type.

Conversation saved
HOOPSY BETA

### Hello! I'm HOOPSY

Your multilingual generative AI assistant for documentation. Ask me anything about HOOPS Exchange in your own language, or choose a sample question below to start a conversation:

What is HOOPS Exchange?
What are the latest release notes for HOOPS Exchange?
How do I start evaluating HOOPS Exchange?
How do I write my first sample application?
How can I get assistance?

HOOPSY may store conversations according to OpenAI's policy. Responses may not always be accurate.

HOOPSY is thinking...