Question about NeoSheet - Forum

Forum Navigation
You need to log in to create posts and topics.

Question about NeoSheet

Hi @luisp

I'm trying to work with neosheet which is a very good plugin.

I want to hide the column which contain the row number, I tried neoSheetSetColumnWidth "Container3"0 -1 0 and
neoSheetDeleteColumn "Container3" 0 -1 1 without success.

neoSheetDeleteColumn seems not working with any number of column.

when I use neoSheetGetCellValue "Container3" 0 "B10" false [Eux], I get the formula, but if I change false by true, I do not get the value ?

For the functions neoSheetGetValueById and neoSheetSetValueById what is the cell Id ?

For the functions neoSheetSetCellBackgroundColor and neoSheetSetCellStyle, is it possible to put a range instead of a cell, or to have functions neoSheetSetRowBackgroundColor, neoSheetSetColBackgroundColor, neoSheetSetRowStyle, neoSheetSetColStyle ?

 

@phil78 Using VisualNEO Web GPT:

From the current neoSheet help, your findings are mostly consistent with how the plugin is exposed in VisualNEO Web.

1) Hiding the row-number column

What you are trying to hide is not a normal data column.
In neoSheet, neoSheetSetColumnWidth and neoSheetDeleteColumn work with real worksheet columns, using a 0-based column index. So column 0 means the first sheet column (A), not the left row-number gutter.

That is why this:

neoSheetSetColumnWidth "Container3" 0 0 0

would affect column A, and not the row numbers. Likewise, neoSheetDeleteColumn "Container3" 0 0 1 would try to delete the first worksheet column, not the index gutter.

Also, I do not see any documented neoSheet command such as neoSheetHideIndex or similar in the current help. The underlying Jspreadsheet library does have an index gutter and documents methods such as hideIndex() / showIndex(), which supports the idea that the row-number strip is a separate UI element, not a worksheet column.

So the practical answer is:

  • neoSheetDeleteColumn is not meant to remove the row-number gutter.
  • there is no documented neoSheet wrapper command for hiding that gutter in the VisualNEO Web help I checked.

If you want, the next thing to test would be a CSS-only workaround targeting the index cells, but that would be a workaround, not an official neoSheet command.


2) Why neoSheetDeleteColumn seems not to work

According to the help, the syntax is:

neoSheetDeleteColumn "objId" sheetIndex colIndex count

where:

  • sheetIndex = worksheet index
  • colIndex = starting column index
  • count = how many columns to delete.

So this is the correct shape:

neoSheetDeleteColumn "Container3" 0 1 1

That should delete worksheet column index 1 = column B, not the row numbers.

If it is not deleting any real column either, then it looks like either:

  • the command is failing in your specific setup, or
  • the sheet/container reference is not the one you think it is, or
  • the plugin has a bug in that build.

But based on the help, your original call with colIndex = -1 is definitely outside the documented usage. The command expects a normal start column index.


3) neoSheetGetCellValue with false vs true

The help says:

neoSheetGetCellValue "objId" sheetIndex "cellRef" computed resultVar

and for computed the description is:

  • false → raw cell value
  • true → calculated value.

So in theory:

neoSheetGetCellValue "Container3" 0 "B10" false [Eux]

should give the raw content, for example the formula string.

And:

neoSheetGetCellValue "Container3" 0 "B10" true [Eux]

should give the computed result.

However, Jspreadsheet’s own documented getter distinguishes between raw data and processed/displayed value, and says the processed value is taken from the rendered cell content rather than the stored data. That means a formula/result mismatch can happen depending on how neoSheet maps its computed flag internally.

So my reading is:

  • the neoSheet help intends true to return the calculated result,
  • but if you are getting nothing, that is likely a wrapper issue / plugin bug / limitation, not misuse of the syntax.

You could also compare with:

neoSheetGetFormattedValue "Container3" 0 "B10" [Eux]

because that command is specifically documented to return the formatted value.


4) What is the cell ID for neoSheetGetValueById / neoSheetSetValueById

The help only says:

neoSheetGetValueById "objId" sheetIndex "id" resultVar
neoSheetSetValueById "objId" sheetIndex "id" "newValue"

and describes "id" only as “The ID of the cell”. It does not explain how that ID is assigned or how to retrieve it.

So based on the help alone, this part is underdocumented.

Important detail: the underlying Jspreadsheet documentation talks clearly about row IDs as unique identifiers for rows, but not in the snippets I checked about a standard user-facing “cell ID” system equivalent to A1.

Because neoSheet already provides normal cell addressing by reference:

  • neoSheetGetCellValue
  • neoSheetSetCellValue
  • neoSheetGetCellObject
  • neoSheetSetCellStyle

my recommendation is: use "A1"-style cell references whenever possible, because those are documented and clear. For now, GetValueById / SetValueById look like commands that need better official explanation.


5) Can neoSheetSetCellBackgroundColor / neoSheetSetCellStyle use a range?

From the help, both commands accept "cellRef", and the examples/descriptions only mention a single cell, such as A1.

So officially documented usage is:

neoSheetSetCellBackgroundColor "Container3" 0 "A1" "#ffff00"
neoSheetSetCellStyle "Container3" 0 "A1" "text-align:left;background-color:yellow"

not a range.

By contrast, the help does explicitly support ranges for neoSheetSetRangeReadOnly, where "A1:C3" is documented as valid.

That difference strongly suggests:

  • range support is documented for read-only
  • range support is not documented for style/background commands.

So I would not rely on ranges there unless you test them yourself and confirm they work in your build.


6) Is there any SetRowBackgroundColor, SetColBackgroundColor, SetRowStyle, SetColStyle?

I do not see documented neoSheet commands with those names in the current help.
What is documented is:

  • cell background color
  • cell style
  • row properties
  • row height
  • column width
  • row/column read-only.

So at the moment, the plugin appears to expose:

  • direct styling at cell level
  • structural/property control at row/column level
  • but no dedicated row/column style/background commands.

Bottom line

Your conclusions are reasonable:

  • the row-number gutter is not a worksheet column, so neoSheetDeleteColumn / neoSheetSetColumnWidth will not hide it.
  • neoSheetDeleteColumn should only work with real columns starting at index 0 = A.
  • neoSheetGetCellValue(..., true, ...) is documented to return the computed value, so getting nothing looks like a plugin issue rather than wrong syntax.
  • neoSheetGetValueById / neoSheetSetValueById are poorly documented because the help does not explain how to obtain the cell ID.
  • style/background commands are documented for single cells, not ranges.
  • I do not see any documented row/column style/background commands.

A practical workaround for styling a row/column is to loop through the needed cells and apply neoSheetSetCellStyle one by one.

Hi @luishp

Thank you for these detailed answers.

However, I can confirm that neoSheetDeleteColumn does not work, nor does neoSheetGetCellValue with true, and that neoSheetGetFormattedValue crashes (TypeError: $App[(objId + “Sheet”)][sheetIndex].getFormattedValue is not a function). This is annoying because we cannot perform any actions on a cell's value.

Finally, I asked support if we could hide the index column, and the answer is yes, worksheets[0].hideIndex();

The documentation specifies this in the column methods :

showIndex Show the index column for the spreadsheet.

showIndex() => void

hideIndex Hide the index column for the spreadsheet.

hideIndex() => void

Can you fix all of this ?

 

@phil78 I will try to take a look and fix them as soon as possible.
Thank you!

Just a quick correction: neoSheetGetCellValue works when called from a button, but does not work when the command follows the creation of the array.

Insert col and row, delete col and row, showtoolbar  do not seem to work when called from a button .

neoSheetGetRowId crashes ($App[(objId + "Sheet")][sheetIndex].getRowId is not a function)

@phil78 please check the updated plugin and sample app.
Thank you!

(I have updated the files - see next message)

@phil78 I have included some more actions.
Please teake a look at both the updated neoSheet.app and neosheet-sample.neoapp

Uploaded files:
  • You need to login to have access to uploads.
Vadim has reacted to this post.
Vadim

Hi @luishp

I've tested it, and everything is OK. There's still a minor issue with `neoSheetHideIndex`: the height of empty rows is minimized.

Insert col and row, delete col and row, showtoolbar  do not seem to work when called from a button .

I misunderstood something; in fact, if we set `false` for row and column insertion and deletion in the initialization, those commands don't operate.

 

Isn't the `worksheet index` parameter missing from the `neoSheetInit` command? If not, how do I create a sheet with multiple worksheets?

Thank you

Hi @luishp

Isn't the `worksheet index` parameter missing from the `neoSheetInit` command? If not, how do I create a sheet with multiple worksheets?

The solution is to use neoSheetCreateWorksheet.

neoSheetRenameWorksheet and neoSheetCreateWorksheet does not give the name of the worksheet, we always see sheet1, sheet2 ....

In the documentation they say: Starting with version 11.1.0, you can programmatically apply styles to entire rows or columns using ranges.

instance.setStyle('A:A', 'background-color', 'pink');
instance.setStyle('1:1', 'background-color', 'blue');

can you implement this function and also for nestedHeaders(title, colspan), SetFreezeRows, SetFreezeColumns ?

Thank you

@phil78 please note theplugin is using the CE (Community Edition) version, not the 11.1.0 PRO version.

Hi @luishp

Ok I read the CE documentation, we cannot use the style for for an entire column or row.

But nestedHeader, and freeze column or row are missing but documented and I need them. And there is still a bug with the name of tabs.

Please, can you fix them  ?

@phil78 sorry for the delay.
I have fixed the plugin, please download and check the updated sample app.
Thank you!

Uploaded files:
  • You need to login to have access to uploads.

Thank you @luishp

I tried using nestedheader, footer, and freeze during initialization, but it didn't work. You're probably not using version 4 of the library.

 

@phil78 I'm using version 4.
Please include a sample app showing the problem.
Thank you!

@luishp

I solved the problem for the footer.

I have included on the json, tableoverflow, footers, freezeColumns, nestedHeaders inside the file config.json. You can load it with your neosheet-sample app.

rename config.svg config.json

Uploaded files:
  • You need to login to have access to uploads.