In previous posts I tried to share my knowledge about joomla frontend custom form.In this chapter I’m going to show how to show data table in frontend and some operations in that data table ex:- Search,Filter etc.
I’m presenting this based on my previous posts about Joomla Frontend Custom Form Developing (Step 1, Step 2, Step 3).
In this part lets create the table.I’m creating mrl_region table for this example.it contain 3 columns id,Name and userid.Bellow is sql query for creating table and inserting data.I’ve used “mrl” prefix for table.This is the prefix I gave on joomla installation.
I hope to continue this lesson using com_myresourcelist which I used to my pervious blog posts.
Let’s name our table as Regions.Add controller class as regions.php to components/com_myresourcelist/controllers folder.
Add model class as regions.php to components/com_myresourcelist/models folder.
Next we’ll create view for our table.For that create regions folder on com_myresourcelist/views.Then tmpl folder inside regions folder.Make sure to add empty index.html file on each newly created folder.
Add view.html.php to com_myresourcelist/views/regions folder.
Create following files inside com_myresourcelist/views/regions/tmpl folder.
default.xml
default.php
default_head.php
default_body.php
default_foot.php
Now you have finished front end table.Create new menu item for our table.Select Menu Item type as Regions Table .
By clicking new menu item in the front end you will see the table as follows.
Next post we’ll see how to filter table data.
Hello
ReplyDeleteI am still wainting for the post how to filter table data
however i noticed that
1- the herlper RegionsHelper don't exist and the call for addToolbar() in MyResourceListViewRegions Line 30 is commented
2- The absence of links to edit and delete views in the tmpl files default*.php
I don't understand the onset of the item "Regions Table" line in the admin menu.
as I already said in my last post your Posts gave me great help, I'll try to add Helpers, views for editing and waiting for your new posts
You can't use admin tool bar in front end directly.That's why i've commented line 30. I'll post my new post as soon as possible. It'll help you to continue edit, delete and add new record functionality.
Deletehappy New Year
ReplyDeleteI hope this year will be full of motivation and new posts
Happy new year you too :) thanks for motivation. I'll keep the post continue in this year.
Delete