• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
HTML table class

#1
Does anyone know if the HTML table class will be supported in CI4? 

I did some searching and couldn't find it.
Reply

#2
You are right! It isn't in the list of ported components, and hasn't come up in any discussions that I can remember ... it fell through the cracks!! Is this something that should be in CI4?
Reply

#3
I never used it! Is it as it sounds: takes an array and displays it as an HTML table? a la CLI::table()?
Reply

#4
(04-11-2019, 01:04 PM)ciadmin Wrote: You are right! It isn't in the list of ported components, and hasn't come up in any discussions that I can remember ... it fell through the cracks!! Is this something that should be in CI4?

In my mind, it was discussed and explicitly excluded. But I wouldn't put money on that.

I have thought about porting it to C4 because the C3 library is a core component in a lot of backend code I regularly implement. I've been waiting for the C4 codebase to solidify before proceeding. Guess we're almost at that point.

I have also given a little thought to creating a version based on the Grid Layout CSS spec instead of <table> and its related HTML elements

Maybe we need a poll about this functionality?
Reply

#5
Just to throw my 2 cents in, I use it all the time for simple tables because its trivial to add the js DataTables class to the id and have a well formatted table without writing loops.

the one thing I do is extend it with a Library so I can send the column name along with the data, if you write custom functions for your tables it makes it very easy to do custom formatting. Usually I use this to convert the id column of a query to checkboxes for quick CRUD tables.

The table and calendar libraries are what brought me to CI initially, if its not included I know I can just extend it, but I think as a way to attract new and sometimes inexperienced users its great. Throwing a table up on screen out of a database is something people do millions of times a day.
Reply

#6
if you want to use it -> just copy the file to CI4, set correct namespace and have fun^^
maybe add a service entry to get global access

the class use nothing ci related so there should be no problems ( didnt test )

https://github.com/bcit-ci/CodeIgniter/b.../Table.php
Reply

#7
(04-24-2019, 06:08 AM)puschie Wrote: if you want to use it -> just copy the file to CI4, set correct namespace and have fun^^
maybe add a service entry to get global access

the class use nothing ci related so there should be no problems ( didnt test )

https://github.com/bcit-ci/CodeIgniter/b.../Table.php

Actually, there is something. The generate method will accept either an array or an instance of CI_DB_result as an argument. So to allow the same kind of functionality will require some additional thought. I haven't done that thinking I've no idea if it will be trivial or it a can of worms. Smile

If no one else takes this up I will... eventually. (Please, feel free to beat me to it.)
Reply

#8
This could be something for 4.0.1
Reply

#9
sorry oversee it
-> here quick updated for ci4 https://pastebin.com/GyspEyeX
Reply

#10
Submitted https://github.com/codeigniter4/CodeIgniter4/pull/1978 with the CI4 implementation for this.
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.