Loading...
 
Skip to main content

History: Spreadsheet jq

Source of version: 53 (current)

Copy to clipboard
            ^ The Tiki spreadsheet feature was [https://tiki.org/article70|added to Tiki in 2004 (version 1.9)] using Tiki specific PHP and JavaScript code. Starting in ((Tiki5)), the Tiki spreadsheet front-end was upgraded to use ((Spreadsheet jq|jquery.sheet)) for a much nicer interface, and more features. It worked well for years, and eventually, jQuery.sheet was renamed to WickedGrid. However, WickedGrid [https://github.com/Spreadsheets/WickedGrid/commits/master|has been inactive for years] so we need to switch to one of the [https://jspreadsheets.com/|many impressive modern alternatives]. If you would like to help with this, we are looking for financial sponsors and/or volunteer developers. And later, testers. Please contact [https://evoludata.com/Get-In-Touch|Marc Laporte].^

^ This page should ((merge)) with ((Spreadsheet)) ^


! Spreadsheet using jQuery.sheet
The ((Spreadsheet)) feature can be be accessed through the jquery.sheet interface, added to Tiki since version 5.0

!! A review of jQuery.Sheet
[http://roberto.open-lab.com/2010/01/30/javascript-grid-editor-i-want-to-be-excel/|Light years beyond other solutions at least as first impression, jQuery.sheet by Robert Plummer is a really wonderful library.]

!! Usage

When adding a new spreadsheet, the interface is as usual in ((Tiki5)): you have the option to allow wiki parsing of wiki content inside the spreadsheet, plus defining some parent relationship with other spreadsheets:

{img src="display235" imalign=center} 

When editing the spreadsheet, you can add more rows and columns, add content to them, move among the cells using the cursor keys, etc. If wiki parsing was enabled for the spreadsheet, then you can add any wiki syntax to the cell (including ((Wiki plugins))!)

::{img src="display233" class=reflect}:: 

That wiki markup will be parsed when saved.

::{img src="display234" class=reflect} ::

New sheets can be added when clickling at the plus sign ("+") at the bottom of the spreadsheet.

::{img src="display232" }::

Then, this new sheet is added to the workbook.

::{img src="display236" imalign=center}:: 

!! Spreadsheet Help

{CODE()}
{sheet(id=2)}
{CODE}

{sheet(id=2)}

And

{CODE()}
{sheet(id=2 simple=y width="100%" height="100%" subsheets=n)}
{CODE}

{sheet(id=2 simple=y width="100%" height="100%" subsheets=n)}

References:
* Jquery.sheet: http://www.visop-dev.com/jquerysheet.html
  [http://visop-dev.com/Project+jQuery.sheet|updated link to jQuery.sheet]
* ((Jquery))
* ((Spreadsheet))
* ((Tiki5))

!! Tiki6 features
A lot of work has happened from Tiki5 to Tiki6, 
* Fill down, fill right
** including formulas which update
* colors of cell and text
* Copy-paste from Excel
* Make cells referencing variable names
** Done - through use of calculations engine function CELLREF (example: "=CELLREF('mycell')"), but you must first set the cell's name using jQuery.sheet.instance[i].setCellRef()
* Remember columns size 
* Added startup option "minSize: {rows: 15, cols: 5}" and fn "checkMinSize" that will automatically add columns/rows
* Merge & unmerge cell
* Better error reporting (ex.: if a formula has a loop)
* Uses AJAX for smoother user experience
* ((PluginSheet))
** Show a range of cells (or single cell). Default shows all. e.g. "D1:F3" (or "e14:e14")
*** This allows using in a wiki page the result from a spreadsheet cell! (that's going to be very powerful for dynamic reports in wiki pages, not only of graphs but also from specific results from calculations). Budgets for projects, shown in wiki pages dynamically, etc. Templates of invoices, etc.
** Now handles multisheet
* The project plugin "jsanalysis" was dropped due to license issues, but it has been migrated those same functions to a new library for sheet: "jquery.sheet.advancedfn".  Thus, we can now use this in the future for more advanced functions used in sheet for those users who need them. List of functions included:
** {QUOTE()}
                FACTORIAL: jQuery.factorial,
                COMBINATION: jQuery.combination,
                PERMUTATION: jQuery.permutation,
                GAMMA: jQuery.gamma,
                PRECISION: jQuery.precision,
                MINIMUM: jQuery.minimum,
                MAXIMUM: jQuery.maximum,
                MEAN: jQuery.mean,
                SUM: jQuery.sum,
                MODE: jQuery.mode,
                MEDIAN: jQuery.median,
                QUARTILES: jQuery.quartiles,
                VARIANCE: jQuery.variance,
                MEANDEV: jQuery.meandev,
                STDEV: jQuery.stdev,
                COVARIANCE: jQuery.covariance,
                CORR_COEFF: jQuery.corr_coeff,
                UNIFORM: jQuery.uniform,
                BINOMIAL: jQuery.binomial,
                BINOMIALCDF: jQuery.binomialcdf,
                NEGBIN: jQuery.negbin,
                NEGBINCDF: jQuery.negbincdf,
                HYPGEOM: jQuery.hypgeom,
                HYPGEOMCDF: jQuery.hypgeomcdf,
                EXPONENTIALCDF: jQuery.exponentialcdf,
                POISSON: jQuery.poisson,
                POISSONCDF: jQuery.poissoncdf,
                NORMCDF: jQuery.normcdf,
                LINEAR_REG_EQ: jQuery.linear_reg_eq,
                SECANTMETHOD: jQuery.secantmethod,
                FIVEPT: jQuery.fivept,
                FCRIT: jQuery.fcrit,
                ASR: jQuery.asr
{QUOTE}

!!! History: sheet differences shown
Since ((Tiki6)) spreadsheets versions can be compared showing easily  differences between any pair of versions: pink background for deleted content, green background when new content has been added, and prepending a "+" sign for the new text added, and a negative "-" sign for text deleted.

Example:

Sheet in edit mode, showing the new toolbar specific from the spreadsheet feature:

{CENTER()}{img fileId="323" alt="" rel="box[g]" class=reflect}{CENTER} 

When you click in the "History" button below each spreadsheet when it is in view mode, you are shown a table to choose which versions you want to compare:

{CENTER()}{img fileId="324" alt="" rel="box[g]" class=reflect}{CENTER}

Then, after you select any pair, you can click on "compare", and you can see the differences between those two versions of the same spreadsheet:

{CENTER()}{img fileId="325" alt="" rel="box[g]" class=reflect}{CENTER}

Note that scrollbars will be locked together to ease navigation on them both synchronized on the same columns at the sme time with a single scrollbar movement.

!!! New syntax for formulas
You can use some formulas like in OOo Calc or MS Excel, using slightly different syntax (because the JQ Spreadsheet is using Javascript for the formulas):

{CODE(wrap="1", colors="javascript")}
=IF(E10=="Y",695,IF(E10=="N",495,"ERROR"))
{CODE}

or like this

{CODE(wrap="1", colors="javascript")}
=IF(SHEET1:E10=="N",0.08,IF(SHEET1:E10="Y",0.25,"ERROR"))
{CODE}

Aliases:
* (alias(Spreadsheet Jquery)) | (alias(Spreadsheet jquery.sheet)) | (alias(jquery.sheet))