⚠ 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 forum is read-only and soon will be archived. ⚠


Felipe Matos

Member Since 25 Feb 2013
Offline Last Active May 18 2014 08:58 PM
-----

Posts I've Made

In Topic: [WORKAROUND] Redirect to the list after insert/update without changing the co...

12 February 2014 - 06:04 PM

I have the same doubt the acontreras.... how to pass the primary key.... somebody knows?


In Topic: Add Action with Edit Page

24 January 2014 - 12:02 AM

Hi - web-johhny just added ids to the div tags so you can insert your own action buttons using Javascript/jQuery a lot easier. Be sure to download the latest files from github to make use of it :)

A quick example of adding a quick button calling a custom javascript function:
 

$(document).ready(function(){
	$('.pDiv').append('<div class="form-button-box"><input type="button" value="Custom" onclick="javascript: custom_function()"></div>');
});
also you can specify which state to add it to. For example if you want to just use the "edit" state and not the "list" state you can do something like this:

$state = $this->grocery_crud->getState();
if($state == "edit") {
	//insert your code here - will only display on the edit state
}
Hi KaBaDaBrA,
 
Could you explain better. For example, where I put the JQuery code, and where is the record id variable that I am editing. 
 
I Would like add a delete button in edit form.
 
Thank you!

In Topic: Delete button on edit view

08 January 2014 - 01:54 PM

Hi everybody,

 

Thanks for the Grocery Crud, is very usefull.

 

My doubt is how I fix the problem of the prompt messege. 

 

I try the getState == 'delete' but I dont give sucess!

 

Someone help?

 

Sorry my english! :blink:


In Topic: Add custom action button in edit form

06 January 2014 - 12:51 PM



Hello and welcome to the forums shuvo_mahfuz.

If you mean the same way we do by using the add_action unfortunately no there is not.

But you can make tthis button statically by modifing the assets/grocery_crud/themes/your_theme/views edit.php file.

Otherwise you can inspect the getState and on $state == 'edit' inject some js/jq code.

 

In $state == 'edit' , the string is at the top of the page. 

 

How do I do to pass the $crud->getStateInfo()->primary_key for edit.php or to put this "primary_key" side of the cancel button for example?


In Topic: SET type interface with checkbox

08 November 2013 - 06:42 PM

Hi Kenta Saito, 

 

Firstly, thanks for share your code.
 
But, could explain better how edit the library of Grocery Crud, because it was a bit confused.

 

Sorry my english.