Welcome Guest, Not a member yet? Register   Sign In
Library to present table-based data from SQL query
#1

[eluser]jhob[/eluser]
I am just starting on coding up the admin interface for my latest CI project and am looking for a library that will allow me to present data from a SQL query in an HTML table, basically a data grid. Before I code my own I was wondering if there's an existing library out there that does this?

The requirements would be:
* data can be ordered asc or desc by clicking on column heading
* search box to query specified columns
* have an actions column for edit/delete etc
* Paging

I have used the non-CI creative table (http://www.creativedreams.eu/creative_table/) before which does do what I want, but it is pretty messy so I'd rather stay away from trying to shoe-horn it into a CI project.

Is there anything out there that would suit my needs or that I could take a starting point to develop further to my own needs?

Thanks in advance for any replies,

John
#2

[eluser]jhob[/eluser]
Just found http://carbogrid.com/index.php/sample/home which looks like it fits the bill. Going to put it through its paces now.

Alternative suggestions still welcome!
#3

[eluser]jhob[/eluser]
Well the carbogrid download seemed to have all the CI core files bundled with it and not enough documentation to say what you needed to copy over and what you didn't so I abandoned that and found GroceryCrud (http://www.grocerycrud.com/) instead which so far has been really great. Very straight-forward install and worked right out of the box.
#4

[eluser]tazoony[/eluser]
Hi,

I'm working on a fork of DMZ_HtmlForm (DM's extension), what I renamed DMZ_HtmlCrud.
I fixed some problems with forms rendering, and I'm working on a paged list rendering.

I strongly think we should let Bootstrap or other CSS/JS libraries manage appearance. Current libraries are too much mixing Views and Models functions...as well I know that it's not easy to make the great separation.

My library will need Datamapper use.

Usage example :
Code:
$member = new Member();
  $member
   ->select('id, email, zipcode')
   ->render_list($this->input->get('page'));

This example shows a members table, with specified fields in select.

It would be ready in few days.


Joffrey
#5

[eluser]jhob[/eluser]
Thanks for that Joffrey, I'll check it out when it's ready.

Got to say I'm pretty damn impressed with GroceryCrud. It's very complete, easy to use and nicely configurable.
#6

[eluser]tazoony[/eluser]
[quote author="jhob" date="1385583962"]Thanks for that Joffrey, I'll check it out when it's ready.

Got to say I'm pretty damn impressed with GroceryCrud. It's very complete, easy to use and nicely configurable.[/quote]

GroceryCrud is very complete, I was impressed too ! But I strongly need a fully compatible CRUD library with Datamapper. That's why I'm working on it.

I just merged GroceryCrud and DMZ_HtmlForm, on what I added some miscellaneous ideas Big Grin
It seems working. I need to test and improve some things again.

For example, here the code I put in my controller method :
Code:
$this->htmlcrud_manage('member', array('id','email_md5','firstname','lastname','zipcode','birthdate'));
As you can guess, parameters are :
- Datamapper class name to use
- Fields that you want to see in the table

Everything else is automatically set up with Datamapper validation information :-)

I also developed another Datamapper extension that is named "DataStructure". Its goal is to import Mysql database structure information into Datamapper object's validation array. It seems working...I'll share it when it will be ready.




Theme © iAndrew 2016 - Forum software by © MyBB