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_bAllowRichTextmust 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. Text fields first take the format specified inm_pCellFormat, then attributes might be overloaded with the rich text formatting. For example, “text-align” specified in xml style attribute overrides the alignment specified inm_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 tom_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 functionA3DPDFDocumentAddImageAsIcon2().getScrollTableDataForCheckedRows(scrolltableuuid,idxcolcheckboxinscrolltable)
- 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.
//(pcSTName:returnedbyA3DPDFWidgetGetName) //(idxColCheckBox:indexofcolumnwithcheckboxesinthescrolltable) vartablecheckedrows=this.getScrollTableDataForCheckedRows('"'+pcSTName+'","'+to_string(idxColCheckBox)+'"'); for(i=0;i<tablecheckedrows.nbrows;i++) rowscheckedforcol0.push(tablecheckedrows.data[i][0]);uncheckAllScrollTableData(scrolltableuuid,idxcolcheckboxinscrolltable)
- 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
enableScrollTableCheckBoxes(scrolltableuuid,idxcolcheckboxinscrolltable,enable)
- 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
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: where For example, a javascript code could be as follows to get all values for the first column of rows with a checked checkbox: Also for a column of typekA3DPDFCheckBoxContent, the functionA3DPDFCheckBoxSetForCheckAllColumn()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: where 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. whereReturns
A3D_SUCCESS in case of success or an error code- scrolltableuuid is the scrolltable unique id, it can be retrieved with the API
Variables
-
A3DInt32
A3DPDFScrollTableData.m_iGridNbRows -
The number of rows in the frame.
-
A3DInt32
A3DPDFScrollTableData.m_iGridNbCols -
The number of columns in the frame.
-
A3DInt32
A3DPDFScrollTableData.m_iGridHeightCells -
The height of cells in the frame.
-
A3DInt32 *
A3DPDFScrollTableData.m_piGridWidthCells -
Array of the widths of the cells.
The array must be of size m_iGridNbCols.
-
A3DInt32
A3DPDFScrollTableData.m_iSliderWidth -
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 -
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 -
Optional.
Color to highlight a row. If NULL, default color is used (same color as Acrobat fields highlighting).
-
A3DPDFEColumnType *
A3DPDFScrollTableData.m_peColumnTypes -
Array of the types of the cells.
The array must be of size m_iGridNbCols. If NULL, all cells are of
kA3DPDFTextContenttype.