Versions Compared

Key

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

...

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


Example 4 - Add New Row using Javascript

After performing example 3 above, we can use the script below to programmatically add new rows into the speadsheet.


Code Block
languagejs
	var col = hot.countRows();	
    hot.alter('insert_row', col, 1);	
    hot.setDataAtCell(col, 0, '-Name-');
    hot.setDataAtCell(col, 1, '-Surname-');
    hot.setDataAtCell(col, 2, '-Age-')


Reference: https://jsfiddle.net/ck4859zm/