Posted 4 January 2023, 4:41 am EST
Hi Admin,
How can I get row height when row it visible is false
Tks you sir.
Forums Home / Spread / SpreadJS
Posted by: cangod05 on 4 January 2023, 4:41 am EST
Posted 4 January 2023, 4:41 am EST
Hi Admin,
How can I get row height when row it visible is false
Tks you sir.
Posted 5 January 2023, 3:36 am EST
Hi,
For this, you may need to first need to toggle visibility and then get the height. Please refer to the following code snippet and let me know if you face any issues.
function getRowHeight(sheet, rowIndex) {
sheet.suspendPaint();
let isVisible = sheet.getRowHeight(rowIndex);
sheet.setRowVisible(rowIndex, true);
let h = sheet.getRowHeight(rowIndex);
sheet.setRowVisible(rowIndex, isVisible);
sheet.resumePaint();
}
function getColumnWidth(sheet, colIndex) {
sheet.suspendPaint();
let isVisible = sheet.getColumnVisible(colIndex);
sheet.setColumnVisible(colIndex, true);
let w = sheet.getColumnWidth(colIndex);
sheet.setColumnVisible(colIndex, isVisible);
sheet.resumePaint();
return w;
}
Regards,
Avinash
Posted 7 January 2023, 11:14 am EST
Tks your solution, but When user deleted a row I set that is invisible and with zero height But some cases I want to check that is Deleted or Filter feature. Do you have solution for this to check set visible by Coder or filter by user.
Posted 9 January 2023, 3:12 am EST
Hi,
For getting notified whenever the user deletes a row you may use the RowChanged event. Please refer to the following code snippet and let me know if you face any issues.
ss.bind(GC.Spread.Sheets.Events.RowChanged,(e,args)=>{
if(args.propertryName==”deleteRows”){
console.log(“Row has been deleted“,args);
};
});
for getting to know if a row is filtered out or not. You may use is isRowFilterOutmethod.
sheet.isRowFilterOut(rowIndex);
Regards,
Avinash