Starting point for editing table rows |
[eluser]ytjohn[/eluser]
Hi, I'm fairly familiar with PHP and just starting out with CI. I working on a knowledge base type application and was wondering if there were any "starting off" points for editing rows in a database. I ultimately want this to be an AJAX deal (but I'll take non-ajax starting points as well): I have a simple table "categories" with 7 columns. I would like to display the contents of this table as an HTML table. Non-AJAX: Click edit, new page, make your changes, hit Update, and get returned to the table. AJAX: Click on a field in the table, get an edit box (or drop-down), make your change, and click update. That row will update. Further with AJAX: The table has a column called "weight" that determines the sort order. If you're familiar with Mambo/Joomla, it has up/down arrows that will essentially change the weight *and* update the list order. While I understand that there is probably no "cookie-cutter" setup for this, I hoping to not have to re-invent the wheel on something that seems fairly common. Thanks in advance.
[eluser]Ahmed Nuaman[/eluser]
Well, the best place to start is the user guide: http://ellislab.com/codeigniter/user-gui...index.html You'll find everything you need to know there. In terms of AJAX, I find the practices are: - Keep calls to just POST - Create an AJAX function within each controller (instead of one global AJAX controller) - Add this at the top (relative to keeping calls to POST) if (empty($_POST)) { show_404(); }
[eluser]ytjohn[/eluser]
Turns out what I was looking to do was a more complex subjec than I thought. I ended up comparing Nested Sets and MPTree. I ultimately went with the nested sets solution found here: http://ellislab.com/forums/viewthread/47671/ I think MPTtree (http://ellislab.com/forums/viewthread/74114/#394395) has a more advanced underlying class, but they both use the same method, and Thunder UK's nested set categories_demo was scarily almost exactly what I was looking for. I'm still working on my solution, but I'm using the CI Ajax class (found in the wiki) that builds upon prototype. I also integrated greybox (http://www.orangoo.com/labs/GreyBox/), which is really a great tool kit if you don't want to have to worry about updating divs and stylesheets. |
Welcome Guest, Not a member yet? Register Sign In |