$crud->set_relation_n_n('actors', 'film_actor', 'actors', 'film_id', 'actor_id', 'name',null, null, TRUE);
$crud->unset_edit_fields(array('extra_field_{relation_table_field_name}'));
$crud->unset_edit_fields(array('extra_field_salary'))
⚠ 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. ⚠
Posted 07 April 2013 - 14:16 PM
$crud->set_relation_n_n('actors', 'film_actor', 'actors', 'film_id', 'actor_id', 'name',null, null, TRUE);
$crud->unset_edit_fields(array('extra_field_{relation_table_field_name}'));
$crud->unset_edit_fields(array('extra_field_salary'))
Posted 07 April 2013 - 18:04 PM
Hello Stratos. Please allow some time to inspect your findings and let you know about the results.
I would suggest you make a pull request, if you are familiar with github, from here https://github.com/scoumbourdis/grocery-crud/pulls
Thanks again for your post!
Posted 13 May 2013 - 01:58 AM
Hi Stratoe, i'm trying to use your tabs, but still no luck. I believe it will be a great component, since i always hack for adding extra fields, and its make my code look dirty. Can you explain more how to configure your tabs?
Thanks.
Posted 13 May 2013 - 07:08 AM
Hi dimazarno!
What kind of problem are you experiencing?
To setup this mod:
$crud->set_relation_n_n('actors', 'film_actor', 'actors', 'film_id', 'actor_id', 'name',null, null, TRUE);
That's pretty much it
Posted 13 May 2013 - 10:40 AM
Hello [member=Stratos Provatopoulos].
I had a quick look on your proposal.
If you can, it would be better to follow the guidelines on how we structure an extension for Grocery CRUD.
By doing this, you help everybody to use the functionality you propose, even with the future versions of Grocery CRUD.
We try to avoid the direct changes of the library itself.
So, when we post an extension/update, within the zip file (or via github), a) we honour the folder structure e.g.
assets\grocery_crud\js\your_file
and we try to use this suggestion that is endorsed by the creator of the library [member=web-johnny], as the proper way of extending the functionality of Grocery CRUD.
Thank you for your contribution. If you make the above recommended changes we will have a look at your code.
Posted 30 July 2013 - 08:39 AM
Hi Stratos, I've been trying to make it work by following your instructions, but I got some errors like:
"Uncaught ReferenceError: jQuery is not defined
Uncaught ReferenceError: $ is not defined"
I think that it could be because of my GC version. Which was yours?
I'll be searching for the solution, but I'll really appreciate your help. Thanx!
Posted 31 July 2013 - 07:00 AM
Hello ludwigbernard
My GC version is 1.3.
The error that you are getting is that there is no jQuery so you can simply include it yourself in the header of your file.
I am sorry that I have yet to submit my code as a proper extension, but I have been really swamped and I don't think that I will be able to in the foreseeable future
Posted 02 August 2013 - 13:20 PM
Hi Stratos Provatopulos, i need that you give me a solution for this problem please, i´m using your library for assigning several roles to one functionary. for the moment this show me the information that i insert manually to database but it not insert and not update, it is always loading and never finish. bottom i give you some pictures. how can i debug the problem?
Posted 03 August 2013 - 10:59 AM
Hello Victacora
Can you tell me what is the output of the chrome console?
1. Right click and press inspect element before you press update/insert
2. Go to the Network tab
3. Press update or insert. (don't press update and go back to list or insert and go back to list)
4. In the Network tab, there should be an new entry, since the update is done via AJAX, like this youdormain.com/your_controler/update/id
can you please tell me what is the output of AJAX call?
Posted 03 August 2013 - 21:43 PM
Hi Stratos Provatopulos, here is the image that i get from chrome console, i dont understand the part where appear update_validation? this function i have not implemented. i wait for you answer, thank you.
Posted 04 August 2013 - 06:45 AM
Update validation always runs whether you have implemented or not. Usually if you haven't set any rules you just get success:true.
But since I don't since the other ajax call that actually implements the update I am guessing that something is wrong.
If you click on that entry a new panel should appear on the right. I actually wanted that output.. sorry I forgot to mention it
Posted 04 August 2013 - 16:55 PM
of course, this show me a new tab when i click in the option, and it show me the information of database. but it never update or insert on the database.
Posted 04 August 2013 - 23:04 PM
No I meant in the network tab, if you click on the update_validation ajax call, the one you showed me in your previous post, you should see the raw output of the server. Can you please attach a screenshot with this information
Posted 05 August 2013 - 12:12 PM
ok, here is the output from chrome console http://politecnicodesistemaseidiomas.com/Output and addition here show me this error when i add new role to functionary this show me the new tab but appear this error Uncaught ReferenceError: tinymce_options is not defined.HOWEVER works well. thanks again
Stratos ProvatopoulosPosted 05 August 2013 - 22:11 PM
Am I also going to need the response of the ajax call not just the header.
Now for the second error. Are you using tiny_mce on your theme? I am afraid that for the time being my solution works only with tinyMce
Posted 05 August 2013 - 22:46 PM
the problem is that it only show me this: Disallowed Key Characters. headers is the only option that show me something. the others tabs show me the sames words... but when i click in the http://localhost:8080/AGLV2/index.php/admin_controller/managementFunctionary/update_validation/1
this open a new tab in the google chrome and show me: {"success":true}.
i find this http://www.diegodicamillo.com.ar/blog/2009/09/28/disallowed-key-characters-codeigniter/ about Disallowed Key Characters.
and the result to modify was this:the Disallowed Key Characters.{primary_key_value}<- in this expression is the error.i hope that it can be of any use. thank you again...I will continue to trying again.
Posted 06 August 2013 - 08:08 AM
OK now I am starting to understand.
The problem is at the addTab function located at jquery.tab.config.js.
This function is supposed to replace the string "{primary_key_value}" with the value of the option that you select from the dropdown (in your example the dropdown is the input which says Seleccione Cargos). The select input is populated with the contents of the table that you are linking to (in you example Cargo).
My first question is whether that table (Cargo) has a primary key which is set to auto_increment
If you have set a primary key on that table, then I would like you to see if there are any javascript errors in the console that stop the execution of javascript. You should also check that the correct javascript files are linked from their respective paths.
If there aren't any javascript errors and the correct files are loaded, then I want you to go to the jquery.tab.config.js file which is located at \assets\grocery_crud\js\jquery_plugins\config\jquery.tab.config.js, go to line 12 and change the code from
tabContentTemplate = $('#'+field+"Template").html(), tabContentHtml = tabContentTemplate.replace( /\{primary_key_value\}/g, value )
to
tabContentTemplate = $('#'+field+"Template").html(), alert(tabContentTemplate); alert(value); tabContentHtml = tabContentTemplate.replace( /\{primary_key_value\}/g, value ) alert(tabContentHtml);
Execute your example and please reply with the contents of the alertbox.
Posted 06 August 2013 - 20:13 PM
Posted 06 August 2013 - 21:37 PM
I am afraid that I am having trouble understanding you.
If I understand correctly the problem is now solved and you can insert/update/normally.
But you want to obviate something... What exactly do you want to obviate?
Posted 06 August 2013 - 21:53 PM
no the problem is the same, sorry but my pooor english. this was send all, the fields with information that i insert and the fields with {primary_key_value} and this generate the error that exit on the server. i wanna obviate this part on the form values {primary_key_value}