⚠ 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

how can I get non editable row?



jcasanova
  • profile picture
  • Member

Posted 13 April 2012 - 17:58 PM

I need the user is able to see a list of rows but cant edit some of them

any ideas?

xxaxxo
  • profile picture
  • Member

Posted 14 April 2012 - 08:02 AM

$crud->edit_fields('fields_you_want_to_be_edited');

jcasanova
  • profile picture
  • Member

Posted 14 April 2012 - 21:37 PM

Thats fo edit, i need a non editable field, show it but not editable (in tue edit form)

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

Posted 14 April 2012 - 22:08 PM

This is not yet available on grocery CRUD and I cannot think any customization for this. I am sorry. You have to change the main library to add this functionality.

jcasanova
  • profile picture
  • Member

Posted 14 April 2012 - 22:14 PM

Oh ok, I will look the library if I can do something, ill let you now if get it work

xxaxxo
  • profile picture
  • Member

Posted 15 April 2012 - 05:01 AM

maybe you can do it with callback and set up your field read-only - i haven't done it but you can try.

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

Posted 15 April 2012 - 11:00 AM

As I understood you need something like this right? [attachment=108:non-editable-rows.png] . But still the only way is to change the library . Even if you made it to look like this (ex. with javascript or a callback), you still have to be sure that the user cannot edit the row with just knowing the url.

jcasanova
  • profile picture
  • Member

Posted 15 April 2012 - 14:16 PM

No, what I need is inthe "edit" form, example: showing user info, can edit the name but not edit the email, but still showing the email.

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

Posted 15 April 2012 - 18:02 PM

This is simple. You can use a simple callback for this, for example :


$crud->callback_edit_field('your_field',function($value= ''){
return $value;
});


or if you don't mind changing the core you can see the topic at http://www.grocerycr...editable-field/