Posted 20 June 2023, 7:15 am EST
Hello,
As I can understand, you want to use checkboxes in a table column to select the records(rows) from the table.
For this use case, you can create a table with TableColumn object and set its cell type to Checkbox. You can bind the TableColumn objects using table.bind() or table.bindColumns() methods. When you click on the checkboxes, the data source value also changes for the clicked cell. You can find which record(row) is selected or not from the data source. Also, you can add a button to select or unselect all the records of the table.
Please refer to the attached sample.
sample: Hello,
As I can understand, you want to use checkboxes in a table column to select the records(rows) from the table.
For this use case, you can create a table with TableColumn object and set its cell type to Checkbox. You can bind the TableColumn objects using table.bind() or table.bindColumns() methods. When you click on the checkboxes, the data source value also changes for the clicked cell. You can find which record(row) is selected or not from the data source. Also, you can add a button to select or unselect all the records of the table.
Please refer to the attached sample.
sample: spread_react_typescript.zip
Please unzip the file and use the commands “npm i” and “npm run dev” to install dependencies and run the sample respectively.
Please let us know if you still face any issues. Also, please describe your use case so that we could tailor it to your requirements.
Doc reference
TableColumn class:https://www.grapecity.com/spreadjs/api/v16/classes/GC.Spread.Sheets.Tables.TableColumn#class-tablecolumn
ButtonClicked event:https://www.grapecity.com/spreadjs/api/classes/GC.Spread.Sheets.Events#buttonclicked
Table class: https://www.grapecity.com/spreadjs/api/classes/GC.Spread.Sheets.Tables.Table
Please unzip the file and use the commands “npm i” and “npm run dev” to install dependencies and run the sample respectively.
Please let us know if you still face any issues. Also, please describe your use case so that we could tailor it to your requirements.
Doc reference
TableColumn class:https://www.grapecity.com/spreadjs/api/v16/classes/GC.Spread.Sheets.Tables.TableColumn#class-tablecolumn
ButtonClicked event:https://www.grapecity.com/spreadjs/api/classes/GC.Spread.Sheets.Events#buttonclicked
Table class: https://www.grapecity.com/spreadjs/api/classes/GC.Spread.Sheets.Tables.Table
regards,
Avinashspread_react_typescript (1).zip