Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Tip
iconfalse

https://handsontable.com/docs/6.2.2/Options.html#selectionMode

Use case: To limit Limit the cell(s) that can be selected to only single cell.

Copy & paste this code snippet into Custom Settings.

Code Block
themeConfluence
{
    selectionMode: 'single'
}

 

Example 2 - Custom invalid cell style

Tip
iconfalse

https://handsontable.com/docs/6.2.2/Options.html#invalidCellClassName

Use case: Change the appearance of a cell if values does not match regex validation (regex configurable in spreadsheet properties).

First, use a Custom HTML form element to write a simple class style. Do use the !important notation only if the style is being overridden.

Code Block
languagecss
<style>
	.invalidCellCustom {
		background:pink !important;
	}
</style>

Then, copy & paste this code snippet into Custom Settings.

Code Block
themeConfluence
{
	invalidCellClassName: 'invalidCellCustom'
}

 

Example 3 - Get spreadsheet handsontable instance by form element ID

Tip
iconfalse

https://handsontable.com/docs/6.2.2/Core.html

Use case: Get the spreadsheet handsontable instance to use core functions.

First, copy & paste this code snippet into Custom Settings.

Code Block
themeConfluence
{
    "afterInit" : function() {
        var hot = this;
        $(hot.rootElement).data("hot", hot);
    }
}

Then, use a Custom HTML form element to get the 'hot' instance. After that, you are able to perform core functions on your specified spreadsheet element.

Code Block
languagejs
<script>
	$(function(){
    	var hot = FormUtil.getField("_yourSpreadsheetFormElementIdHere_").data("hot");
		//console.log(hot.getSettings());
		//hot.setDataAtRowProp(0, '_yourcellColumnIdHere_', '_myNewValue_');
	});
</script>