Class: Bs_SpreadSheet
Source Location: /components/spreadsheet/Bs_SpreadSheet.class.js.php
Bs_SpreadSheet.class.js - clientside spreadsheet editor, excel-like.
Author(s):
Version:
Copyright:
|
|
|
Inherited Variables
|
Inherited Methods
|
Class Details
Class Variables
$buttonsPath = '/_bsImages/buttons/'
[line 292]
the image path for the button toolbar.
Tags:
$debug = false
[line 68]
are we in debug mode or not? default is false.
Tags:
$defaultCellHeight = 20
[line 240]
default cell height in pixels. default is 20.
Tags:
$defaultCellWidth = 80
[line 223]
default cell width in pixels. default is 80.
Tags:
$editorI =
[line 272]
don't recall what this was for, but it's needed.
$editorJ =
[line 276]
don't recall what this was for, but it's needed.
$firstColTitle = false
[line 95]
tells if the first col is a title col. this is important for sorting.
Tags:
$firstRowTitle = false
[line 86]
tells if the first row is a title row. this is important for sorting.
Tags:
$mayUseAlign = true
[line 123]
if the cell alignments may be specified (left, center, right). default is true.
Tags:
$mayUseClipboard = true
[line 109]
if the clipboard can be used, by buttons and shortcuts.
Tags:
$mayUseFormat = true
[line 116]
if cell formatting may be used (bold, italic, underline). default is true.
Tags:
$mayUseWysiwyg = true
[line 130]
if the cell wysiwyg editor may be used. default is true.
Tags:
$numCols = 6
[line 154]
the initial number of columns. if the used data (in the constructor) has more, then there are more. set to 0 if you don't want this feature.
Tags:
$numRows = 10
[line 165]
the initial number of rows. if the used data (in the constructor) has more, then there are more. set to 0 if you don't want this feature.
Tags:
$objectName =
[line 61]
the name of this object instance that is in the global scope. absolutely needed.
Tags:
$returnType = 'array'
[line 194]
the return type. :) 'array' => javascript array. that's the default. 'csv' => string, comma separated values à la excel
Tags:
$sheedHeight = 230
[line 267]
the height of the sheet area in pixels.
Tags:
$sheetWidth = 450
[line 258]
the width of the sheet area in pixels.
Tags:
$showLineNumbers = true
[line 77]
if line numbers should be displayed or not. default is true.
Tags:
$useToolbar = true
[line 102]
if the button bar should be used. default is true.
Tags:
$_currentCellLastValue =
[line 215]
need in case the user cancels the edit mode to write it back.
Tags:
Class Methods
method addCol [line 345]
void addCol(
mixed
pos, bool
noRedraw)
|
|
add a col into the data array param pos: int position, value from 0-n (yes it may be 0, starts at 0 not 1.) or bool true (left of current cell) false (right of current cell) or nothing/null/undefined => at the end
Tags:
Parameters:
method addRow [line 414]
void addRow(
mixed
pos, bool
noRedraw)
|
|
add a row into the data array param pos: int position, value from 0-n (yes it may be 0, starts at 0 not 1.) or bool true (above current cell) false (below current cell) or nothing/null/undefined => at the end
Tags:
Parameters:
method calculateCellHeight [line 1529]
void calculateCellHeight(
)
|
|
calculates the height for each row.
Tags:
method calculateCellSizes [line 1567]
void calculateCellSizes(
)
|
|
!!! not used [anymore?] !!!
method calculateCellWidth [line 1506]
void calculateCellWidth(
)
|
|
calculates the width for each column.
Tags:
method cellSelect [line 1051]
void cellSelect(
object cell
cell)
|
|
selects a new cell. deselects the curently selected cell.
Tags:
Parameters:
method draw [line 631]
[re]draws the editor.
Tags:
method editCellEnd [line 1151]
void editCellEnd(
object cell
cell)
|
|
stops edit mode for the given cell, goes back into active mode.
Tags:
Parameters:
method editCellStart [line 1119]
void editCellStart(
object cell
cell)
|
|
makes the given cell the active one, starts edit mode.
Tags:
Parameters:
method emptyValue [line 1607]
void emptyValue(
int
row, int
col)
|
|
removes the content of a cell, col, row or the whole table. if row is NaN then the whole row is emptied. same for col. currently only works if both row and col are given.
Tags:
Parameters:
method exportDataToCsv [line 607]
string exportDataToCsv(
)
|
|
exports the data, and only the data (no style information) to cvs format.
Tags:
method formatAlign [line 1719]
void formatAlign(
bool
left, bool
center, bool
right)
|
|
formats the alignment of the current cell. one or none of the given params may be true.
Tags:
Parameters:
method formatBold [line 1652]
void formatBold(
bool
val)
|
|
formats the currently selected cell bold.
Tags:
Parameters:
method formatItalic [line 1673]
void formatItalic(
bool
val)
|
|
formats the currently selected cell italic.
Tags:
Parameters:
method formatUnderline [line 1694]
void formatUnderline(
bool
val)
|
|
formats the currently selected cell underline.
Tags:
Parameters:
method getCellCaption [line 1472]
int getCellCaption(
string
cellId)
|
|
returns a string like C5 or B7.
Tags:
Parameters:
method getCol [line 1457]
int getCol(
string
cellName)
|
|
returns the col number of the cell with the given name. starts at 0, not 1.
Tags:
Parameters:
method getNumCols [line 1495]
returns the number of cols.
Tags:
method getNumRows [line 1482]
returns the number of rows.
Tags:
method getRow [line 1440]
int getRow(
string
cellName)
|
|
returns the row number of the cell with the given name. starts at 0, not 1.
Tags:
Parameters:
method init [line 557]
void init(
array
data, string
drawTagId, string
callbackFunction)
|
|
inits the editor with the given data. calls draw().
Tags:
Parameters:
method onGlobalPaste [line 1365]
void onGlobalPaste(
element
cell)
|
|
fires on a paste on a cell. by hitting ctrl-v or clicking the paste button.
Parameters:
method onPaste [line 1346]
void onPaste(
mixed
cell)
|
|
method pasteValue [line 1397]
void pasteValue(
string
value, element
cell)
|
|
Tags:
Parameters:
method removeCol [line 482]
remove a col from the data array param pos: if not given (not numeric) then the col of the currently selected cell will be removed.
Tags:
Parameters:
method removeContent [line 1427]
void removeContent(
object cell
cell)
|
|
clears the content of the given cell.
Tags:
Parameters:
method removeRow [line 520]
remove a row from the data array param pos: if not given (not numeric) then the row of the currently selected cell will be removed.
Parameters:
method save [line 1020]
set the data back to the caller.
Tags:
method setDrawStyle [line 1008]
void setDrawStyle(
string
drawStyle)
|
|
sets the draw style. redraws the editor.
Parameters:
method setMousePointer [line 302]
void setMousePointer(
bool
work)
|
|
changes the cursor icon to something else. i think this one did not work like i wanted it to, so it's not used. (i wanted to set the sandbox while the computer is working...)
Tags:
Parameters:
method setValue [line 1620]
void setValue(
string
val, int
row, int
col, bool
noRedraw)
|
|
sets the given value for the given cell.
Tags:
Parameters:
method sortAsc [line 1811]
sorts the sheet in ascending order on the col of the currently selected cell.
Tags:
method sortDesc [line 1826]
sorts the sheet in descending order on the col of the currently selected cell.
Tags:
method toHtml [line 1885]
string toHtml(
bool
withStyle)
|
|
exports the data table as html output.
Tags:
Parameters:
method typing [line 1201]
handles the keydown event.
Tags:
method updateDataFromFields [line 985]
void updateDataFromFields(
)
|
|
walks through the structure of the data array and replaces all values with the new ones that are currently set in the page/form by the user.
Tags:
method _readFromClipboard [line 1903]
void _readFromClipboard(
mixed
key)
|
|
|
|