⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

Suggestion for future release



Kobus Myburgh

Kobus Myburgh
  • profile picture
  • Member

Posted 07 October 2012 - 15:28 PM

Hi guys,

I have a question regarding a suggestion for future releases, and was wondering if this could be implemented in a later version of Grocery CRUD.

Let's say I have 3 tables:

Table: page (has 7 fields)
Table: box (has 5 fields)
Table: page_box (has 3 fields, namely page_id, box_id, position)

I have set up "Manage pages" and added a n_n relationship for the boxes, as follows:


$crud->set_table($this->config->item('db_prefix') . 'page');
$crud->set_relation_n_n('Boxes', $this->config->item('db_prefix') . 'page_box', $this->config->item('db_prefix') . 'box', 'page_id', 'box_id', 'title');


This works fine in the sense that I can assign boxes to the pages IF I do have defined boxes, but, if you do not have any boxes defined, you get a message that says "Please add boxes first" or something to that effect. How about allowing addition of boxes via a popup, which then immediately becomes available for selection in the "Manage pages" screen? This would be an awesome addition, in my opinion!

Thanks!

Kobus

Kobus

Kobus
  • profile picture
  • Member

Posted 26 November 2012 - 06:49 AM

This can be done with actions, as Victor pointed out, but only from the listing page. I think making an "action" in the add/edit screen would be great. The same thing that does it for the listing page could possibly be made for the edit screen. I would like to check this out and see how I can make this work.

davidoster

davidoster
  • profile picture
  • Member

Posted 26 November 2012 - 09:47 AM

The way I understand this, is that you could have within your controller a function that can be called(virtually from anywhere you want it) to display a popup window for addition.

Then this function could be called either automatically, when you get to a page with an empty dataset, or upon user request.
The way I see it it shouldn't be hardcoded to GC library so it gives freedom to the individual developer on how to approach this.

Kobus

Kobus
  • profile picture
  • Member

Posted 07 January 2013 - 14:35 PM

David, correct - not hard coded, but I was wondering if there is an "add_action" commend available for ONLY the add/edit screens :-)

Kobus

zrmba

zrmba
  • profile picture
  • Member

Posted 02 February 2013 - 10:48 AM

Hi there, should read here:
/topic/364-answered-set-relation-and-add-new-button-to-quick-insert/

Kobus

Kobus
  • profile picture
  • Member

Posted 03 February 2013 - 16:19 PM

Thanks, zrmba, I saw that. I was just wondering if the "add_action" could be added to "add/edit" screens as opposed to the list screen. When there are no items to link to in the add/edit screen, I would like to add a new item on the fly.

 

The default "add_action" adds the icon to the list screen only, if I am not mistaken? Am I missing something?

 

Thanks!

 

Kobus


davidoster

davidoster
  • profile picture
  • Member

Posted 05 February 2013 - 09:03 AM

Thanks, zrmba, I saw that. I was just wondering if the "add_action" could be added to "add/edit" screens as opposed to the list screen. When there are no items to link to in the add/edit screen, I would like to add a new item on the fly.

 

The default "add_action" adds the icon to the list screen only, if I am not mistaken? Am I missing something?

 

Thanks!

 

Kobus

As it says here, http://www.grocerycrud.com/documentation/options_functions/add_action

"Add an action/operation to the list table."

So you are right, add_action works on the list page.

I suppose somebody could make an extend on grocery_crud controller and make the add_action_add_delete function that adds on the add/edit forms!

But this, is not yet implemented!!!


Kobus

Kobus
  • profile picture
  • Member

Posted 05 February 2013 - 09:28 AM

Hi David,

 

Thank you. That confirms it. I know better than to promise to look into it, but I will try. :-)

 

Regards,

 

Kobus