On a table using DataTables and the REST API wrapper with the column filters, if one input is used to filter the table the query will be made twice: when the user stopped typing and when the input will lose the focus.
Created attachment 176147 [details] [review] Bug 38827: DataTables - Do not filter when inputs lose focus On a table using DataTables and the REST API wrapper with the column filters, if one input is used to filter the table the query will be made twice: when the user stopped typing and when the input will lose the focus. Test plan: Search for patron Open the dev console, "Network" tab In the "Card" column filter enter "0000" Notice that the table is filtered and that a request has been made Click outside of the "Card" input => Without this patch another request (the same) is made and the table updated => With this patch applied no request is made when the input loses the focus.
Created attachment 176162 [details] [review] Bug 38827: DataTables - Do not filter when inputs lose focus On a table using DataTables and the REST API wrapper with the column filters, if one input is used to filter the table the query will be made twice: when the user stopped typing and when the input will lose the focus. Test plan: Search for patron Open the dev console, "Network" tab In the "Card" column filter enter "0000" Notice that the table is filtered and that a request has been made Click outside of the "Card" input => Without this patch another request (the same) is made and the table updated => With this patch applied no request is made when the input loses the focus. Signed-off-by: Jake Deery <jake.deery@ptfs-europe.com>
Worked for me, nice optimisation. Jake.
Created attachment 176197 [details] [review] Bug 38827: DataTables - Do not filter when inputs lose focus On a table using DataTables and the REST API wrapper with the column filters, if one input is used to filter the table the query will be made twice: when the user stopped typing and when the input will lose the focus. Test plan: Search for patron Open the dev console, "Network" tab In the "Card" column filter enter "0000" Notice that the table is filtered and that a request has been made Click outside of the "Card" input => Without this patch another request (the same) is made and the table updated => With this patch applied no request is made when the input loses the focus. Signed-off-by: Jake Deery <jake.deery@ptfs-europe.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Pushed for 25.05! Well done everyone, thank you!