SpreadJS 11 - Error when initializing FormulaTextBox

Posted by: jb9244 on 17 October 2018, 9:10 am EST

    • Post Options:
    • Link

    Posted 17 October 2018, 9:10 am EST

    test

  • Posted 17 October 2018, 9:10 am EST

    SpreadJS 11.0.0 - 11.2.6

    With a div called “spreadsheet” and a div called “formulabar”, the following code will cause a JS error within SpreadJS. It’s caused by a failure to place the text cursor at the end of the formula text box value due to the existence of a multiline cell value and subsequent DOM text node length miscalculation.

    
    spread = new GC.Spread.Sheets.Workbook(document.getElementById("spreadSheet"));
    sheet = spread.sheets[0];
    sheet.setValue(0, 0, "This is\nmultiline text");
    var ftb = new GC.Spread.Sheets.FormulaTextBox.FormulaTextBox(document.getElementById("formulabar"));
    ftb.workbook(spread);
    
    
  • Posted 18 October 2018, 2:38 am EST

    Hello,

    Please have a look at attached sample for the requested functionality wherein focus is set on formulaTextBox and is in edit mode even with multiline text in cell.

    Hope it helps.

    Thanks,

    Reeva

    SpreadJS_FormulaTextBox.zip

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels