“I’m utilizing the hooks provided below to validate and remove rows by selecting the ‘remove row’ option from the context menu. However, despite setting up conditions to restrict row removal based on specific criteria, the removal operation isn’t being restricted as expected when the condition is met.”
this.hot.addHook(“beforeRemoveRow”,(index, amount, physicalRows, [source]) =>{
if(amount>=this.noOfRow){
alert('User is not allowed to remove all rows ')
return;
}
})
this.hot.addHook(“afterRemoveRow”,(index, amount, physicalRows, [source])=>{
this.row_col_add_removal={}
this.row_col_add_removal={‘operation’:‘remove_row’,‘add_index’:null, ‘removal_indexes’:physicalRows,‘tot_cols’:this.noOfColoumn,‘tot_rows’:this.noOfRow}
this.commonService.loadDataInCells({isClicked:true, remove_row:true, amount : amount});
})
Remove row restriction
Hi @rupeshfend
There are some missing variables in the code snippet you sent. Please prepare a code demo where the issue is replicable so I can investigate it and determine what the problem is.
Hi @rupeshfend
It’s been a couple of days since we last heard from you regarding this ticket, so we’re assuming that the issue has been resolved. We’re always here to help if you need further assistance or have any other questions.
Feel free to reopen this ticket or start a new one if needed.
1 Like