This topic is locked

Reset reorder columns

10/3/2020 5:44:14 AM
PHPRunner General questions
W
wypman author

I use the facility to reorder the columns in the list page. I see it creates a database entry in settings table. How can a user reset the view to its default settings. The only thought I can thing of is attaching custom code to a button and delete the entry in the settings table? or is there an easier way?
I tried creating a custom button using the following code:



global $dal;

$tblSettings = $dal->Table("project_settings");

$tblSettings->Param["USERNAME"]= $_SESSION["UserID"];

$tblSettings->Param["TABLENAME"] = "customers";

$tblSettings->Delete();


I Capture the UserID as a session when they login. It doesn't seem to do anything, so I presume I need to force a page refresh?

Sergey Kornilov admin 10/3/2020

First of all - test this manually i.e. delete user's records in the settings table, reload the page and see what happens.
In regards to your code, make sure that "project_settings" is a correct table name.