This code above is ready to use.
For example, you have the above code on a client module named “responsive”, and call it in your form with from ... import responsive or wherever your form is (start typing from and the editor will propose the path) and use it as described:
from ... import responsive
from
self.objects_grid_responsive = ColumnsToShowHide_in_datagrid(self.objects_grid)
with self.objects_grid being a datagrid in your form
self.objects_grid
To deal with mobile or PC, I use this nice code: