Handsontable
- Package
- purescript-handsontable
- Repository
- themoritz/purescript-handsontable
#handsontable Source
handsontable :: forall r d eff. String -> Options d r -> Eff (hot :: HOT | eff) (Handsontable d)#handsontableNode Source
handsontableNode :: forall r d eff. HTMLElement -> Options d r -> Eff (hot :: HOT | eff) (Handsontable d)#alter Source
alter :: forall d eff. AlterAction -> Maybe Int -> Int -> Maybe ChangeSource -> Boolean -> Handsontable d -> Eff (hot :: HOT | eff) UnitInsert new row(s) above the row at given index:
If the second argument is Nothing, the data will be inserted after the last column/row.
alter action index amount source keepEmpty hot.
#colOffset Source
colOffset :: forall d eff. Handsontable d -> Eff (hot :: HOT | eff) IntGet the index of first visible column.
#countCols Source
countCols :: forall d eff. Handsontable d -> Eff (hot :: HOT | eff) IntReturns the total number of columns in the grid.
#countEmptyCols Source
countEmptyCols :: forall d eff. Boolean -> Handsontable d -> Eff (hot :: HOT | eff) IntReturns number of empty columns. If the ending parameter is true, returns number of
empty columns at right hand edge of the table.
#countEmptyRows Source
countEmptyRows :: forall d eff. Boolean -> Handsontable d -> Eff (hot :: HOT | eff) IntReturns number of empty rows. If the ending parameter is true, returns
number of empty rows at the bottom of the table.
#countRenderedCols Source
countRenderedCols :: forall d eff. Handsontable d -> Eff (hot :: HOT | eff) IntReturn the number of visible columns.
#countRenderedRows Source
countRenderedRows :: forall d eff. Handsontable d -> Eff (hot :: HOT | eff) IntReturn the number of rendered rows.
#countRows Source
countRows :: forall d eff. Handsontable d -> Eff (hot :: HOT | eff) IntTotal number of rows in the grid.
#countVisibleCols Source
countVisibleCols :: forall d eff. Handsontable d -> Eff (hot :: HOT | eff) IntNumber of visible columns. Returns -1 if the table is not visible
#countVisibleRows Source
countVisibleRows :: forall d eff. Handsontable d -> Eff (hot :: HOT | eff) IntNumber of visible rows (rendered rows that fully fit inside viewport)
#deselectCell Source
deselectCell :: forall d eff. Handsontable d -> Eff (hot :: HOT | eff) UnitDeselects current cell selection in the grid.
#destroy Source
destroy :: forall d eff. Handsontable d -> Eff (hot :: HOT | eff) UnitRemove the grid from the DOM.
#getCell Source
getCell :: forall d eff. Int -> Int -> Boolean -> Handsontable d -> Eff (hot :: HOT | eff) (Maybe HTMLElement)Returns the TD element for given row, col if it is rendered on screen.
Returns Nothing if the TD is not rendered on screen (probably because that part of table is not visible).
#getCellEditor Source
getCellEditor :: forall d eff. Handsontable d -> Eff (hot :: HOT | eff) CellEditorGet the cell editor by row and col.
#getCellMeta Source
getCellMeta :: forall d eff. Int -> Int -> Handsontable d -> Eff (hot :: HOT | eff) ForeignGet cell properties for given row and col.
#getColHeader Source
getColHeader :: forall d eff. Handsontable d -> Eff (hot :: HOT | eff) (Maybe (Array String))Return column headers (if they are enabled), Nothing otherwise.
#getColWidth Source
getColWidth :: forall d eff. Int -> Handsontable d -> Eff (hot :: HOT | eff) NumberGet the width of the given column
#getCopyableData Source
getCopyableData :: forall d eff. Int -> Int -> Int -> Int -> Handsontable d -> Eff (hot :: HOT | eff) StringGet value of selected range. Each column is separated by tab, each row is separated by new line character.
getCopyableData startRow startCol endRow endCol
#getData Source
getData :: forall d eff. Maybe (Tuple Coords Coords) -> Handsontable d -> Eff (hot :: HOT | eff) (DataTable d)Return the current data table (the same that was passed by data configuration option or loadData method).
Optionally you can provide cell range startCoord, endCoord to get only a fragment of grid data.
#getDataAtCell Source
getDataAtCell :: forall d eff. Int -> Int -> Handsontable d -> Eff (hot :: HOT | eff) dReturn cell value at row, col. row and col are the visible indexes (note that if columns were reordered or sorted, the current order will be used).
#getDataAtCol Source
getDataAtCol :: forall d eff. Int -> Handsontable d -> Eff (hot :: HOT | eff) (Array d)Returns array of column values from the data source. col is the visible index of the column.
#getDataAtRow Source
getDataAtRow :: forall d eff. Int -> Handsontable d -> Eff (hot :: HOT | eff) (Array d)Returns a single row of the data. row is the visible index of the row.
#getRowHeader Source
getRowHeader :: forall d eff. Handsontable d -> Eff (hot :: HOT | eff) (Maybe (Array String))Return row headers (if they are enabled), Nothing otherwise.
#getRowHeight Source
getRowHeight :: forall d eff. Int -> Handsontable d -> Eff (hot :: HOT | eff) NumberGet the height of the given row.
#getSchema Source
getSchema :: forall d eff. Handsontable d -> Eff (hot :: HOT | eff) ForeignGet schema provided by constructor settings or if it doesn't exist return schema based on data structure on the first row.
#getSelected Source
getSelected :: forall d eff. Handsontable d -> Eff (hot :: HOT | eff) (Maybe (Array Int))Return index of the currently selected cells as an array [startRow, startCol, endRow, endCol].
Start row and start col are the coordinates of the active cell (where the selection was started).
#getSelectedRange Source
getSelectedRange :: forall d eff. Handsontable d -> Eff (hot :: HOT | eff) (Maybe Foreign)Returns current selection, or Nothing if there is no selection.
#getSettings Source
getSettings :: forall d eff. Handsontable d -> Eff (hot :: HOT | eff) ForeignGet the current grid settings
#getSourceDataAtCol Source
getSourceDataAtCol :: forall d eff. Int -> Handsontable d -> Eff (hot :: HOT | eff) (Array d)Returns array of column values from the data source. col is the index of the row in the data source.
#getSourceDataAtRow Source
getSourceDataAtRow :: forall d eff. Int -> Handsontable d -> Eff (hot :: HOT | eff) (Array d)Returns a single row of the data. row is the index of the row in the data source.
#getValue Source
getValue :: forall d eff. Handsontable d -> Eff (hot :: HOT | eff) (Maybe d)Get the value from the selected cell, Nothing if no cell is selected.
#hasColHeaders Source
hasColHeaders :: forall d eff. Handsontable d -> Eff (hot :: HOT | eff) BooleanReturns information of this table is configured to display column headers.
#hasRowHeaders Source
hasRowHeaders :: forall d eff. Handsontable d -> Eff (hot :: HOT | eff) BooleanReturns information of this table is configured to display row headers.
#isEmptyCol Source
isEmptyCol :: forall d eff. Int -> Handsontable d -> Eff (hot :: HOT | eff) BooleanCheck if col is empty.
#isEmptyRow Source
isEmptyRow :: forall d eff. Int -> Handsontable d -> Eff (hot :: HOT | eff) BooleanCheck if row is empty.
#isListening Source
isListening :: forall d eff. Handsontable d -> Eff (hot :: HOT | eff) BooleanReturns true if current Handsontable instance is listening to keyboard input on document body.
#listen Source
listen :: forall d eff. Handsontable d -> Eff (hot :: HOT | eff) UnitListen to keyboard input on document body.
#populateFromArray Source
populateFromArray :: forall d eff. Coords -> DataTable d -> Maybe Coords -> Maybe ChangeSource -> PopulateMethod -> Direction -> Array d -> Handsontable d -> Eff (hot :: HOT | eff) (Maybe HTMLElement)Populate cells at position with a 2D input array (e.g. [[1, 2], [3, 4]]):
populateFromArray start input end source method dir deltas hot
Use end when you want to cut input when certain row/column is reached.
Optional source parameter (default value PopulateFromArray) is used
to identify this call in the resulting events (beforeChange, afterChange).
Optional method parameter (default value Overwrite has the same effect as the pasteMethod option.
Returns ending td in populated area, or Nothing if no cell was changed.
#removeCellMeta Source
removeCellMeta :: forall d eff. Int -> Int -> String -> Handsontable d -> Eff (hot :: HOT | eff) UnitRemove key property object from cell meta data corresponding to params of cell at row, col.
#render Source
render :: forall d eff. Handsontable d -> Eff (hot :: HOT | eff) UnitRe-render the table.
#rowOffset Source
rowOffset :: forall d eff. Handsontable d -> Eff (hot :: HOT | eff) IntGet the index of the first visible row.
#selectCell Source
selectCell :: forall d eff. Coords -> Maybe Coords -> Boolean -> Boolean -> Handsontable d -> Eff (hot :: HOT | eff) BooleanSelect cell start or maybe range of cells finishing at end.
By default, viewport will be scrolled to selection and after selectCell
call instance will be listening to keyboard input on document.
#setCellMeta Source
setCellMeta :: forall d eff. Int -> Int -> String -> String -> Handsontable d -> Eff (hot :: HOT | eff) UnitSets cell meta data object key corresponding to params row, col.
#setCellMetaObject Source
setCellMetaObject :: forall r d eff. Int -> Int -> Record r -> Handsontable d -> Eff (hot :: HOT | eff) UnitSet cell meta data object prop to corresponding params row, col
#setDataAtCell Source
setDataAtCell :: forall d eff. Int -> Int -> d -> Maybe ChangeSource -> Handsontable d -> Eff (hot :: HOT | eff) UnitSet a new value to a cell. col is the index of a visible column (note that if columns were reordered,
the current order will be used). source is a flag for before/afterChange events.
#unlisten Source
unlisten :: forall d eff. Handsontable d -> Eff (hot :: HOT | eff) UnitStop listening to keyboard input in document body.
#updateSettings Source
updateSettings :: forall r d eff. Record r -> Boolean -> Handsontable d -> Eff (hot :: HOT | eff) Unit#validateCells Source
validateCells :: forall a d eff. Handsontable d -> (Boolean -> Eff (hot :: HOT | eff) a) -> Eff (hot :: HOT | eff) UnitValidates all cells using their validator functions and calls callback when finished. Does not render the view. If one of cells is invalid callback will be fired with 'valid' arguments as false otherwise true.