![]() |
Template controller to grocery CRUD? - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22) +--- Thread: Template controller to grocery CRUD? (/showthread.php?tid=42617) Pages:
1
2
|
Template controller to grocery CRUD? - El Forum - 06-13-2011 [eluser]web-johnny[/eluser] Hello there. After some revisions of grocery CRUD I see that users don't want to have by default a template controller into grocery CRUD . I just add a template controller to make the experience of grocery CRUD even easier . (Just one line and the crud is ready). But I realized that most of the users had problem with this. Many conflicts , difficult to understand it etc etc. So I create this poll to see if this is true. If so, to the next version of grocery CRUD I will remove the Template controller library (MY_Loader.php and MY_Output.php). Thank you, and of course any other suggestion is more than pleasant. Template controller to grocery CRUD? - El Forum - 06-13-2011 [eluser]timj[/eluser] Since the purpose is to permit fast CRUD development, I don't have a problem with the ready-made templating, although I can see that it does make it more difficult to integrate Grocery CRUD into larger applications. Of much more importance sooner, I think, are features like 'add row' and row callbacks so that users can use to build TOTAL fields and add navigation features. It's not really much use as a 'Grocery CRUD' if you can't tally the cost of the groceries. I think an 'add row' feature would deliver a lot of flexibility and probably get past some of the issues that are annoying others trying to work within the template. Template controller to grocery CRUD? - El Forum - 06-13-2011 [eluser]web-johnny[/eluser] You can use : callback_add_field and callback_edit_field for this. You can first add a fake "field" to your crud (if you make a callback it will not have any problem). for example : Code: $this->grocery_crud->fields('firstname','lastname','email','confirm_email'); Code: $this->grocery_crud->callback_add_field('confirm_email',array($this , 'confirmation_email_input')); Code: function confirmation_email_input() Template controller to grocery CRUD? - El Forum - 06-14-2011 [eluser]timj[/eluser] [quote author="web-johnny" date="1308044082"]You can use : callback_add_field and callback_edit_field for this. You can first add a fake "field" to your crud (if you make a callback it will not have any problem).[/quote] I don't think you understood my comment. You have a column of prices. Of course you can add a fake field to the right of it and build a function to total the entire column of prices. But the TOTAL calculation would have to iterate on every row. And it would be clunky and confusing for users used to how spreadsheets look and work. Instead what you'd want is a new row at the bottom where all the column totals may be calculated just once. What would be handy is a ready callback library of basic SQL counting, math [SUM()] and time [NOW()] functions to build these callbacks around. For myself, I would like the option of adding a row of navigation callbacks, so that I can, for example, limit the query results based on dates. I realize, again, that I could add a fake field... that would have to iterate on each row instead of just once on one row. Good product. Template controller to grocery CRUD? - El Forum - 06-14-2011 [eluser]web-johnny[/eluser] [quote author="timj" date="1308087746"][quote author="web-johnny" date="1308044082"]You can use : callback_add_field and callback_edit_field for this. You can first add a fake "field" to your crud (if you make a callback it will not have any problem).[/quote] I don't think you understood my comment. You have a column of prices. Of course you can add a fake field to the right of it and build a function to total the entire column of prices. But the TOTAL calculation would have to iterate on every row. And it would be clunky and confusing for users used to how spreadsheets look and work. Instead what you'd want is a new row at the bottom where all the column totals may be calculated just once. What would be handy is a ready callback library of basic SQL counting, math [SUM()] and time [NOW()] functions to build these callbacks around. For myself, I would like the option of adding a row of navigation callbacks, so that I can, for example, limit the query results based on dates. I realize, again, that I could add a fake field... that would have to iterate on each row instead of just once on one row. Good product.[/quote] Now I understood what do you mean. Yes Its a good suggestion and I will added as a future plan . Thanks. Template controller to grocery CRUD? - El Forum - 06-14-2011 [eluser]fabgonber[/eluser] web-johnny, An idea... Code: public person() { And with this i can put the CRUD in my view ![]() Today i solve the problem with a modification of the grocery's template. Template controller to grocery CRUD? - El Forum - 06-14-2011 [eluser]web-johnny[/eluser] [quote author="fabgonber" date="1308118193"]web-johnny, An idea... Code: public person() { And with this i can put the CRUD in my view ![]() Today i solve the problem with a modification of the grocery's template.[/quote] I have this example in my website (I just copy the code) Code: public person() { if something like this appears Code: Fatal error: Cannot access protected property Code: $this->output->final_output = ''; so just make the variable public in the CI_Output Class. Template controller to grocery CRUD? - El Forum - 06-15-2011 [eluser]felix_[/eluser] Hey, i tried to add groceryCRUD in the way you described it... Code: <?php but when i try to update/insert an entry i get an error: Code: POST http://localhost/site/users/admin/update_validation 500 (Internal Server Error) Code: [removed]window["_gaUserPrefs"] = { ioo : function() { return true; } }[removed][removed]window.script1308146381998=1;[removed] another thing is the jquery loading... im already loading jquery in the header of my page and grocery will also load it... is there an easy way to stop grocery loading its own jquery? Template controller to grocery CRUD? - El Forum - 06-15-2011 [eluser]a/\ekc[/eluser] Quote:if something like this appears It's no good way to change the core files I think. I can forget in the future, that something was changed in core files. And after update of the core files the same error will be. I voted for default template, but would like to see it more flexible. In grocery_crud.php file functions have such code parts Code: $ci->load->js('public/grocery_crud/js/jquery_plugins/.../somefile.js'); To change template folder i have to go in application/core/MY_Output and change Code: const TEMPLATE_ROOT = "templates/"; My way. I had a project with cms template (application/views/cms/template.php) Code: <?php Code: <?php Both template.php have the same header. So in header.php this code was placed: Code: <?php In cms controller Code: public function my_table() { All works fine but small inconvenience to have two templates Template controller to grocery CRUD? - El Forum - 06-15-2011 [eluser]web-johnny[/eluser] [quote author="felix_" date="1308164616"]Hey, i tried to add groceryCRUD in the way you described it... Code: <?php but when i try to update/insert an entry i get an error: Code: POST http://localhost/site/users/admin/update_validation 500 (Internal Server Error) Code: [removed]window["_gaUserPrefs"] = { ioo : function() { return true; } }[removed][removed]window.script1308146381998=1;[removed] another thing is the jquery loading... im already loading jquery in the header of my page and grocery will also load it... is there an easy way to stop grocery loading its own jquery?[/quote] Parhaps this is a javascript error. I actually don't know what cause this error. A simple way could to unset the jquery could be this : Code: protected function _get_all_javascripts() |