The result is splendid with your changes. I want only suggest to replace the row # 1344 in /gluon/sqlhtml.py with this
jQuery('#w2p_query_fields').val('').change(); so the change event is fired and when you query again the .w2p_query_row is hidden. Ciao. Paolo