136
ParamQuery Pro Evaluation Support / Re: Can't type in text in header filter on Android
« on: July 22, 2023, 07:24:04 pm »
I found the issue, it is due to a Chrome bug (https://bugs.chromium.org/p/chromium/issues/detail?id=1466893#c_ts1689983830)
The issue is that pqGrid, when there is a refresh or refreshView, pqGrid recreates its contents, so instead of just refreshing the grid and not the header, it does both. This means that the selected filter gets destroyed (so it rightfully loses focus) then recreated. We need a refreshGrid that doesn't refresh the header rows, which would fix this.
However, I did create a fix
The issue is that pqGrid, when there is a refresh or refreshView, pqGrid recreates its contents, so instead of just refreshing the grid and not the header, it does both. This means that the selected filter gets destroyed (so it rightfully loses focus) then recreated. We need a refreshGrid that doesn't refresh the header rows, which would fix this.
However, I did create a fix
Code: [Select]
// Get the name of the focused filter
var focus = $(grid).find("input.pq-search-txt:focus),
focused_name= focus.attr("name");
// Do any grid refresh
$(grid).pqGrid("refresh");
// Now find the newly created filter input and select it
if(focused_name) $(grid).find("input.pq-search-txt[name="+focused_name+"]").focus();