⚠ 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

Perform inline editing



vecais
  • profile picture
  • Member

Posted 07 November 2013 - 07:23 AM

Hi everyone!

 

I need to perform inline editing with grocery. I have the latest version from library.

 

I read this post /topic/2009-how-to-perform-inline-editing-in-grocery-crud/

 

but I don´t know if is possible...

 

Any avance or solution?

 

Thank you very much.

 

Best regards,

 

PD: Wonderful library.

 


edramirez
  • profile picture
  • Member

Posted 11 November 2013 - 19:20 PM

Inline editing is not yet available in the current release of gc


vecais
  • profile picture
  • Member

Posted 12 November 2013 - 07:02 AM

Hi edramirez,

 

Is there any alternative of solution?

 

 

Regards,


edramirez
  • profile picture
  • Member

Posted 12 November 2013 - 08:11 AM

I think this feature is interesting and worth some studying. I've already downloaded the files and I plan to test this feature extensively. My windows-based applications in Delphi all had similar functionality. 

 

I'll probably take time out to learn about this jqgrid in a few days. If jqgrid works and it can match the power of grocerycrud's interface, it will probably replace grocerycrud rather than build on top of it. Remember, the tabular view is the centerpoint of grocerycrud. If that can replaced by a fully-functional tabular data entry with all the dazzling features of grocerycrud, there will be no need for grocerycrud.

 

I'll evaluate jqgrid and I'll post my comments here when I'm done.

 

Regards,

 

Ed Ramirez


victor
  • profile picture
  • Member

Posted 12 November 2013 - 09:00 AM

it is an example:

use "callback_column" function
.....
$crud->callback_column('p_sort', array($this, '_callback_sort'));

......

function _callback_sort($value, $row)
{
return '<input type="text" class="sort_ajax" value="' . $value . '" onblur="sort_update(this.value,\'' . $row->p_id . '\')">';
}

and create a js function like this:

function sort_update(value,id)
{
data = 'id='+id+'&value='+value;
$.post('admin/article/sort',data, function(data){

$('#crud_page').trigger('change');
}, 'html');
}


vecais
  • profile picture
  • Member

Posted 12 November 2013 - 15:29 PM

Thanks yoy very much Victor and Ed ramirez,

 

I'll try Victor's solution and I tell you my progress.

 

Best regards,


victor
  • profile picture
  • Member

Posted 13 November 2013 - 13:07 PM

I've made the same functionality in my project and it works pretty well. but if you use that functionality for client's web-site you should use json.

vecais
  • profile picture
  • Member

Posted 13 November 2013 - 16:51 PM

ok, I test Victor's solution and works fine, thanks.

 

Also I'm going to read the post: http://www.grocerycr...lete-selection/

and I think that I'll combine that solution with the mentioned post.

 
So with these two options, I think I have solved.
 
Thanks,

 

 

 

 


ppfoong
  • profile picture
  • Member

Posted 23 June 2014 - 08:43 AM

Hi Victor,

 

I followed your codes, but my javascript function which I put in the View file is not functioning as expected.

 

When I changed the value of a field and move the focus out of the field, the screen refreshed, but the edited value is not saved into the database. The refreshed screen will show the same value as before.

 

Can you explain more on the line "$.post('admin/article/sort',data, function(data)"?

 

What is "admin/article/sort"? Is "admin" the controller class, "article" the function, and I should change "sort" to "edit"?

 

Is there anyway to pass the value by variable (such as $state_url in libraries/Grocery_GRUD.php) instead of hardcoding the path?

 

How to handle if I make use of one URL parameter to run my script?

 

My URL is like this: http://10.10.10.10/project/index.php/main/setitem/123456

 

I use $crud->where in my script so that the table will only show all records belong to "123456" only. How to code this variable into the JS script?

 

Thanks.