How do I access the JavaScript Spreadsheet's cell information?
Description
This knowledge base explains to get all applied property values for a cell in JavaScript Spreadsheet.
Solution
It can be achieved by passing the property names in the argument of “getRangeData” public method. It returns the properties of a particular cell or range of cells based on the property name given in the method. The different types of cell properties available in spreadsheet are described below.
S.NO | Property Name | Description |
---|---|---|
1 | value | Returns the original value of the cell. |
2 | value2 | Returns the raw value of the cell. |
3 | type | Returns the type of the cell. |
4 | cFormatRule | Returns the conditional formatting rule that applied to the cell. |
5 | thousandSeparator | Returns true when the cell contains thousand separator. |
6 | rule | Returns the data validation rule that applied to the cell. |
7 | format | Returns the format class that applied to the cell. |
8 | border | Return the border class that applied to the cell. |
9 | picture | Return the picture ID’s whether the cell contains picture. |
10 | chart | Return the chart ID’s whether the cell contains chart. |
11 | calcValue | Returns the calculated value of the formula cell. |
12 | align | Return the applied alignment property of the cell. |
13 | hyperlink | Returns the hyperlink address that applied to the cell. |
14 | formats | Returns the cell formats that are applied to the cell. |
15 | borders | Returns the border formats that are applied to the cell. |
16 | tformats | Returns the table formats that are applied to the cell. |
17 | tborders | Returns the table borders that are applied to the cell. |
18 | isFilterHeader | Returns true when the cell contains the filter header. |
19 | filterState | Returns the filter state of filter icon whether it is filtered or not. |
20 | tableName | Returns the table name when the cell is present inside the table range. |
21 | comment | Returns the comment that applied to the cell. |
22 | formatStr | Returns the number format string that applied to the cell. |
23 | decimalPlaces | Returns the decimal places that applied to the cell. |
24 | cellType | Return the cell type that applied to the cell. |
25 | sparkline | Return the sparkline ID whether the cell contains the sparkline. |
26 | pivot | Return the pivot ID when the cell is present inside pivot range. |
[JS]
$("#Spreadsheet").ejSpreadsheet({ loadComplete: "loadComplete" });
[RAZOR]
@(Html.EJ().Spreadsheet<object>("Spreadsheet") .ClientSideEvents( events => events.LoadComplete("loadComplete") ) )
[ASPX]
<ej:Spreadsheet ID="Spreadsheet" runat="server"> <ClientSideEvents LoadComplete="loadComplete" /> </ej:Spreadsheet>
[JS]
function loadComplete() { // To get the applied properties for a range of cells in Spreadsheet. var rangeProps = this.getRangeData({ range: [0, 0, 4, 0], property: ["value", "value2", "type", "cFormatRule", "thousandSeparator", "rule", "format", "border", "picture", "chart", "calcValue", "align", "hyperlink", "formats", "borders", "tformats", "tborders", "isFilterHeader", "filterState", "tableName", "comment", "formatStr", "decimalPlaces", "cellType", "pivot", "sparkline"], sheetIdx: 1 });
The following output displayed as the result of the above code in console window.
I hope you enjoyed learning about how to access the JavaScript spreadsheet's cell information.
You can refer to our JavaScript Spreadsheet feature tour page to know about its other groundbreaking feature representations and documentation, and how to quickly get started for configuration specifications. You can also explore our JavaScript Spreadsheet example to understand how to create and manipulate data.
For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls.
If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!