AlexKale Posted June 6, 2016 Share Posted June 6, 2016 Hello! I'm currently working on creating my own Admin tab which will allow me to display & edit data from my custom DB table. I've managed to make it display records from the table and delete them, but I'm stuck on editing records. The main problem seems to be loading an object - feels like it won't fill it's fields. For example, when I open edit tab, it will show empty fields instead of filling them with initial records values (I've got fields like 'name', 'lastname', 'phone' and so on). But it still shows all the records from the table and I can delete them (in the main tab 'window'). I don't need no code but just some info on the basics of ObjectModel and AdminTab classes, like how does it retrieve records from the database and all that stuff. Digging the docs didn't help, so I need some hints where to start with. If necessary I will provide you with the code, but I just want to know how it works. Thank you! Link to comment Share on other sites More sharing options...
im_presto Posted June 7, 2016 Share Posted June 7, 2016 In edit mode, you need to populate the fields with $this->fields_value in renderForm function of controller. Link to comment Share on other sites More sharing options...
AlexKale Posted June 7, 2016 Author Share Posted June 7, 2016 So I should use AdminController instead of AdminTab? Because docs are saying to extend AdminTab class. Link to comment Share on other sites More sharing options...
im_presto Posted June 7, 2016 Share Posted June 7, 2016 AdminTab is for adding new menu tab in admin section. If you are creating your new admin controller in module then you need to extend ModuleAdminController. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now