How i can change update and create url ?
Change update and create url
- Single Page
Posted 31 October 2013 - 07:37 AM
Posted 31 October 2013 - 08:05 AM
ok. for update :
$crud->unset_edit();
$crud->add_action('', '', 'admin/upd','ui-icon-pencil');
and how I can change add?
$crud->add_url = 'admin/add'; - not working
Posted 31 October 2013 - 09:23 AM
Hi МакÑим Гавриленко
Sorry i dont really understand the purpose of your work around as why you want buttons for the same stuff when you already have it provided by GC?
If you insist on adding the button like u have had for edit - u can use the same function add_action
But it dont really make sense. Well for one thing what you can do is...
unset_add()
and add an Add xxx button before displaying the grid and set it to the relevant url you like!!
Happy GCing
Posted 31 October 2013 - 09:34 AM
I necessary, because functional GloceryCrud can not do that I need when adding or editing.
How I can add a button tbefore grid by GloceryCrud? I want same button as GloceryCrud, just change url.
Posted 01 November 2013 - 09:58 AM
well brother - u need to add it in the view file of yours .. before you do echo $output;
Posted 12 November 2013 - 02:33 AM
Hi МакÑим -
Based on your different posts, I observed that you are trying to fit grocerycrud functionality into an existing program in an existing directory structure even before bringing your skills up to standard. Perhaps you are using grocerycrud to compensate for the shortcomings of your existing system. In my analysis, if you continue with your approach, your work will take longer and your code will not really be better than the old.
Grocerycrud offers a new way of doing things provided that you let go of your old stuff. Because you are trying to retrofit grocerycrud, even the most simple operations become difficult and often impossible for you to handle. You really have to take the leap of faith and embrace the technology that grocerycrud has to offer and immerse yourself into the ins and outs of the system - whether positive or negative - and look at applications from a different point of view.
My situation is a clear example of this. Less than 6 months ago I didn't know a single thing about CodeIgniter and GroceryCrud, yet I built my skillset brick by brick until I was able to complete the redesign of my accounting software. In fact I had already completed 50% of the system using Yii. But when I saw GroceryCRUD and committed to learning it, I was able to build the entire accounting system again from scratch in half the time I spent to build 50% of the system in Yii. Each application I have completed is designed to take over 50,000 records per year, so I have ported millions of records from all companies owned by my boss into the system. This shows that GroceryCrud delivers.
I suggest that you give up on your old code rework on it using grocerycrud even if you have to start from scratch. Doing it this way will not only create better code, but it will bring out the best in yourself.
Hope this philosophy helps...
Regards,
Ed Ramirez
Posted 12 November 2013 - 09:10 AM
Привет! I have a solution for you (and it is very simple solution):
create a template for the list page with the "add button"
<div class="row-fluid"> <div id="tbl-header"> <a href="<?= base_url() ?>admin/products/add" class="btn btn-primary">Add</a> <br> Sort by category:<span id="categories"></span></div> <?= $crud['output']; ?> </div>