⚠ 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

Seperators



KaBaDaBrA

KaBaDaBrA
  • profile picture
  • Member

Posted 01 March 2012 - 12:00 PM

Hi again,

Want to find out if its possible to add a seperator or group elements together to add/edit?

Example I have


firstname
lastname
username
password


Anyway I can have it like this with a seperator or seperating fieldset of somekind?


User details:

firstname
lastname

Login Details:

username
password


Thanks :)

web-johnny

web-johnny
  • profile picture
  • Administrator
  • 1,166 posts

Posted 01 March 2012 - 19:28 PM

You mean at the column list right? Yes you can do it with a callback_column . I have an example at: http://www.grocerycrud.com/examples/callback_column_example

KaBaDaBrA

KaBaDaBrA
  • profile picture
  • Member

Posted 01 March 2012 - 19:52 PM

Hi again :)

This is more or less an idea of what I want to achieve...

[img]http://www.edynamics.co.za/downloads/Capture.PNG[/img]

web-johnny

web-johnny
  • profile picture
  • Administrator
  • 1,166 posts

Posted 01 March 2012 - 21:45 PM

Oh I am sorry I didn't understand that. So I am sorry to announce you that this simple thing is still not supported from grocery CRUD. You have to change the library and do something like grouping fields or something like that. If you want a quick solution without changing the core I would suggest some javascript changes with the input names for example:


$("input[name=city]:first").parent().parent().after("Your html here");


or something similar. I don't like to give wrong solutions but for now it is the only way to do this without changing the library. If you want though to do it with a right way you should have a method named group_fields('Your contact details',array(/*Your column names*/)); to the grocery_CRUD library.

web-johnny

web-johnny
  • profile picture
  • Administrator
  • 1,166 posts

Posted 01 March 2012 - 21:53 PM

Look at this post perhaps could help you: /topic/55-id-attributes-in-editphp-and-addphp/page__p__166#entry166 I will include this kind of ids in future version (probably 1.2) to help customisations like yours.

web-johnny

web-johnny
  • profile picture
  • Administrator
  • 1,166 posts

Posted 01 March 2012 - 22:02 PM

Actually I just included this to the next version . See the patch at: https://github.com/scoumbourdis/grocery-crud/commit/672ced464bc419d9ffcbc5581fcd0319d07705d8 . This will make your life easier with Javascript changes , what do you think? ;)

KaBaDaBrA

KaBaDaBrA
  • profile picture
  • Member

Posted 02 March 2012 - 06:12 AM

Once again man...LEGEND! hehehe - Thanks yeah adding ids to the fields will definitely help so much! I used jQuery to use multiple dependent select boxes so this will help for by doing further changes using jQuery :)

Just something regarding the jQuery select boxes, do you know which jQuery function to call to rebuild/reload the select boxes? I want to rebuild the dependent select boxes after the post to my controller returns a json array that I use to populate the child dependent select box. I used the normal select boxes for now to get around that - couldn't find how to rebuild the select boxes on the edit and add states.

Hope i'm making sense hehe. Thanks!! :D

web-johnny

web-johnny
  • profile picture
  • Administrator
  • 1,166 posts

Posted 02 March 2012 - 08:18 AM

Yes this is a tricky one it is:


$(this).trigger("liszt:updated");


So I use it also to the clear Form when adding.


$('.chosen-multiple-select').each(function(){
$(this).trigger("liszt:updated");
});

$('.chosen-select').each(function(){
$(this).trigger("liszt:updated");
});

KaBaDaBrA

KaBaDaBrA
  • profile picture
  • Member

Posted 02 March 2012 - 09:49 AM

CHAMPION!!! This is working PERFECTOS MUNDOS!!! Thanks so much! My life is now complete....almost :P

heruprambadi

heruprambadi
  • profile picture
  • Member

Posted 06 February 2013 - 04:16 AM

hello kadabra and web-jhonny. can you show me how to do it ?
 


deib97

deib97
  • profile picture
  • Member

Posted 01 April 2013 - 07:54 AM

I was copy the last grocery crud...

hello, where i put this code, johnny???

 


Yes this is a tricky one it is:
 

$(this).trigger("liszt:updated");

So I use it also to the clear Form when adding.
 

  $('.chosen-multiple-select').each(function(){
   $(this).trigger("liszt:updated");
  });
 
  $('.chosen-select').each(function(){
   $(this).trigger("liszt:updated");
  });