Other resources

  • jExcel CE
    Jexcel community edition
  • jTools
    Web components, utilities and plugins
  • jExcel quick reference

    Methods

    MethodDescription
    getData: Get the full or partial table data
    @Param boolan onlyHighlighedCells - Get only highlighted cells
    myTable.getData([bool]);
    getRowData: Get the data from one row by number
    @Param integer rowNumber - Row number
    myTable.getRowData([int]);
    getColumnData: Get the data from one column by number
    @Param integer columnNumber - Column number
    myTable.getColumnData([int]);
    setData: Update the table data
    @Param json newData - New json data, null will reload what is in memory.
    myTable.setData([json]);
    setMerge: Merge cells
    @Param string columnName - Column name, such as A1.
    @Param integer colspan - Number of columns
    @Param integer rowspan - Number of rows
    myTable.setMerge([string], [int], [int]);
    getMerge: Get merged cells properties
    @Param string columnName - Column name, such as A1.
    myTable.getMerge([string]);
    removeMerge: Destroy merged by column name
    @Param string columnName - Column name, such as A1.
    myTable.removeMerge([string]);
    destroyMerged: Destroy all merged cells myTable.destroyMerge();
    getValue: get current cell value
    @Param mixed cellIdent - str compatible with excel, or as object.
    myTable.getValue([string]);
    getValueFromCoords: get value from coords
    @Param integer x
    @Param integer y
    myTable.getValueFromCoords([integer], [integer]);
    setValue: change the cell value
    @Param mixed cellIdent - str compatible with excel, or as object.
    @Param string Value - new value for the cell
    myTable.setValue([string], [string]);
    resetSelection: Reset the table selection
    @Param boolean executeBlur - execute the blur from the table
    myTable.resetSelection([bool]);
    updateSelection: select cells
    @Param object startCell - cell object
    @Param object endCell - cell object
    @Param boolean ignoreEvents - ignore onselection event
    myTable.updateSelection([cell], [cell], true);
    updateSelectionFromCoords: select cells
    @Param integer x1
    @Param integer y1
    @Param integer x2
    @Param integer y2
    myTable.updateSelectionFromCoords([integer], [integer], [integer], [integer]);
    getWidth: get the current column width
    @Param integer columnNumber - column number starting on zero
    myTable.getWidth([integer]);
    setWidth: change column width
    @Param integer columnNumber - column number starting on zero
    @Param string newColumnWidth - New column width
    myTable.setWidth([integer], [integer]);
    getHeight: get the current row height
    @Param integer rowNumber - row number starting on zero
    myTable.getHeight([integer]);
    setHeight: change row height
    @Param integer rowNumber - row number starting on zero
    @Param string newRowHeight- New row height
    myTable.setHeight([integer], [integer]);
    getHeader: get the current header by column number
    @Param integer columnNumber - Column number starting on zero
    myTable.getHeader([integer]);
    getHeaders: get all header titles myTable.getHeaders();
    setHeader: change header by column
    @Param integer columnNumber - column number starting on zero
    @Param string columnTitle - New header title
    myTable.setHeader([integer], [string]);
    getStyle: get table or cell style
    @Param mixed - cell identification or null for the whole table.
    myTable.getStyle([string]));
    setStyle: set cell(s) CSS style
    @Param mixed - json with whole table style information or just one cell identification. Ex. A1.
    @param k [optional]- CSS key
    @param v [optional]- CSS value
    myTable.setSyle([object], [string], [string]);
    resetStyle: remove all style from a cell
    @Param string columnName - Column name, example: A1, B3, etc
    myTable.resetStyle([string]);
    getComments: get cell comments
    @Param mixed - cell identification or null for the whole table.
    myTable.getComments([string]);
    setComments: set cell comments
    @Param cell - cell identification
    @Param text - comments
    myTable.setComments([string], [string]);
    orderBy: reorder a column asc or desc
    @Param integer columnNumber - column number starting on zero
    @Param boolean sortType - Zero will toggle current option, one for desc, two for asc
    myTable.orderBy([integer], [boolean]);
    insertColumn: add a new column
    @param mixed - num of columns to be added or data to be added in one single column
    @param int columnNumber - number of columns to be created
    @param boolean insertBefore
    @param object properties - column properties
    myTable.insertColumn([mixed], [integer], [boolean], [object]);
    deleteColumn: remove column by number
    @Param integer columnNumber - Which column should be excluded starting on zero
    @param integer numOfColumns - number of columns to be excluded from the reference column
    myTable.deleteColumn([integer], [integer]);
    moveColumn: change the column position
    @Param integer columnPosition
    @Param integer newColumnPosition
    myTable.moveColumn([integer], [integer]);
    insertRow: add a new row
    @Param mixed - number of blank lines to be insert or a single array with the data of the new row
    @Param integer rowNumber - reference row number
    @param boolean insertBefore
    myTable.insertRow([mixed], [integer], [boolean]);
    deleteRow: remove row by number
    @Param integer rowNumber - Which row should be excluded starting on zero
    @Param integer numOfRows - number of lines to be excluded
    myTable.deleteRow([integer], [integer]);
    moveRow: change the row position
    @Param integer rowPosition
    @Param integer newRowPosition
    >myTable.moveRow([integer], [integer]);
    download: get the current data as a CSV file myTable.download();
    getMeta: get the table or cell meta information
    @Param mixed - cell identification or null for the whole table.
    myTable.getMeta([string]);
    setMeta: set the table or cell meta information
    @Param mixed - json with whole table meta information.
    myTable.setMeta[mixed]);

    Working example


    Events

    Eventdescription
    onload This method is called when the method setData
    onbeforechange Before a column value is changed.
    onchange After a column value is changed.
    onpaste After a paste action is performed in the javascript table.
    oninsertrow After a new row is inserted.
    ondeleterow After a row is excluded.
    oninsertcolumn After a new column is inserted.
    ondeletecolumn After a column is excluded.
    onresizerow After a row is resized.
    onresizecolumn After a column is resized.
    onmoverow After a row is moved to a new position.
    onmovecolumn After a column is moved to a new position.
    onselection On the selection is changed.
    onsort After a colum is sorted.
    onfocus On table focus
    onblur On table blur

    Example on handling events on jExcel


    Initialization

    Parameterdescription
    url Load a external json file from this URL: string
    csvFileName Default filename for a download method: string
    csvHeaders Load header titles from the CSV file: bool
    csvDelimiter Default delimiter for the CSV file: string
    csv Load a external CSV file from this URL: string
    data Load this data into the javascript table: array
    rows Row properties: height.: object
    columns Column type, title, width, align, dropdown options, text wrapping, mask, etc.: object
    nestedHeaders Define the nested headers, including title, colspan, etc: object
    defaultColWidth Default width for a new column: integer
    minSpareRows Minimum number of spare rows
    minSpareCols Minimum number of spare cols
    minDimensions Minimum table dimensions: [cols,rows]
    columnSorting Allow column sorting: bool
    columnDrag Allow column dragging: bool
    columnResize Allow column resizing: bool
    rowResize Allow row resizing: bool
    rowDrag Allow row dragging: bool
    editable Allow table edition: bool
    allowInsertRow Allow insert a new row: bool
    allowManualInsertRow Allow user to insert a new row: bool
    allowInsertColumn Allow insert a new column: bool
    allowManualInsertColumn Allow user to create a new column: bool
    allowDeleteRow Allow delete a row: bool
    allowDeleteColumn Allow delete a column: bool
    allowRenameColumn Allow rename a column: bool
    wordWrap Global text wrapping: bool
    selectionCopy Allow selection copy: bool
    tableOverflow Allow table overflow: bool
    tableHeight Force the max height of the table: integer
    tableWidth Force the max width of the table: integer
    allowComments Allow comments over the cells: bool
    contextMenu Context menu content: function() { return customMenu }
    toolbar Add custom toolbars: object
    mergeCells Cells to be merged in the table innitialization: object
    style Cells style in the table innitialization: object
    pagination: integer Break the table by pages
    search: bool Allow search in the table
    lazyLoading: bool Activate the table lazyloading
    text: object All messages to be customized

    Language

    KeyDefault value
    noRecordsFound No records found
    showingPage Showing page {0} of {1} entries
    show Show
    entries entries
    insertANewColumnBefore Insert a new column before
    insertANewColumnAfter Insert a new column after
    deleteSelectedColumns Delete selected columns
    renameThisColumn Rename this column
    orderAscending Order ascending
    orderDescending Order descending
    insertANewRowBefore Insert a new row before
    insertANewRowAfter Insert a new row after
    deleteSelectedRows Delete selected rows
    editComments Edit comments
    addComments Add comments
    comments Comments
    clearComments Clear comments
    copy Copy...
    paste Paste...
    saveAs Save as...
    about About
    areYouSureToDeleteTheSelectedRows Are you sure to delete the selected rows?
    areYouSureToDeleteTheSelectedColumns Are you sure to delete the selected columns?
    thisActionWillDestroyAnyExistingMergedCellsAreYouSure This action will destroy any existing merged cells. Are you sure?
    thisActionWillClearYourSearchResultsAreYouSure This action will clear your search results. Are you sure?
    thereIsAConflictWithAnotherMergedCell There is a conflict with another merged cell
    invalidMergeProperties Invalid merged properties
    cellAlreadyMerged Cell already merged
    noCellsSelected No cells selected