Filter with minSpareRow problem

Tags: #<Tag:0x00007efc6e345050>

Hi, I’m having trouble with filter and minSpareRow = 1

I want alway have a spare row at the end even if the data being filtered with condition is not blank
But when I remove filter condition, there are 2 blank row at the end. How can I fix this problem ?
I just want alway there’s 1 spare row at the end


https://jsfiddle.net/TonyNguyen001/spd2cwt4/2/

Thanks in advance !

Hi @khanguyen96

I think that the best way would be to alter the filter conditions. Meaning to use the beforeFilter logic to add the condition to show the empty row if it was not specified in the first place. I do not have an exact demo for your request. But I think that this demo will help http://jsfiddle.net/handsoncode/c8phv3dy/. It shows how to navigate within the hook output.

Thank for your help !
I resolved by add 2 function

beforeFilter(conditionStack) {
 this.updateSettings({
   minSpareRows: 0
 })
},
afterFilter(conditionsStack) {
this.updateSettings({
 minSpareRows: 1
})
},

Thank you for the update @khanguyen96
I’m happy to see that it works for you.