⚠ 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

1.4 view button



thaMink

thaMink
  • profile picture
  • Member

Posted 29 July 2013 - 22:22 PM

Hey, so I see you've added a "View" button to the grids in 1.4.  I don't however see an unset_view method.  How do I remove the "view" button from the grids if I don't need them?

 

Thanks.

 


davidoster

davidoster
  • profile picture
  • Member

Posted 30 July 2013 - 02:06 AM

Hello and welcome to the forums [member=thaMink].

As of stable version 1.4 there is a new public method added that is:

 

void unset_read()

 

and it Unsets the read(view) operation from the list.

Example:

function employees_delete_management()
{
$crud = new grocery_CRUD();
 
$crud->set_theme('datatables');
$crud->set_table('employees');
$crud->set_relation('officeCode','offices','city');
$crud->display_as('officeCode','Office City');
$crud->set_subject('Employee');
$crud->unset_add();
$crud->unset_edit();
$crud->unset_read();

$output = $crud->render();

$this->_example_output($output);
}

thaMink

thaMink
  • profile picture
  • Member

Posted 31 July 2013 - 18:53 PM

Super.  Thanks for the reply.


kenshicu

kenshicu
  • profile picture
  • Member

Posted 01 August 2013 - 13:32 PM

good,

 

I think, should update the documentation, to learn about new methods of GC 1.4

 

http://www.grocerycrud.com/documentation/options_functions


axxella

axxella
  • profile picture
  • Member

Posted 05 August 2013 - 21:46 PM

how to make the button only displays the operation view?

thanks

 


davidoster

davidoster
  • profile picture
  • Member

Posted 05 August 2013 - 22:44 PM

Hello and welcome to the forums [member=axxella].

Use the unset_add, the unset_delete and unset_edit.


axxella

axxella
  • profile picture
  • Member

Posted 06 August 2013 - 12:23 PM

Thanks for answering so quickly!
Probe do what I decis
unset_add ()
unset_edit ()
unset_delete ()
but it turns out so will the view button.

What I can do?
I just want to show the view button.

Greetings.


axxella

axxella
  • profile picture
  • Member

Posted 06 August 2013 - 12:32 PM

I use

unset_add ()
unset_edit ()
unset_delete ()

but disappears the view button also
What I can do?

Greetings.


superdan

superdan
  • profile picture
  • Member

Posted 06 August 2013 - 15:37 PM

ok solved

 

in 

 

/assets/grocery_crud/themes/flexigrid/views/list.php

 

on line 18

replace

<?php if(!$unset_delete || !$unset_edit || !empty($actions)){?>

with

<?php if(!$unset_delete || !$unset_edit || !$unset_read || !empty($actions)){?>

and

on line 35

 

replace

<?php if(!$unset_delete || !$unset_edit || !empty($actions)){?>

with

<?php if(!$unset_delete || !$unset_edit || !$unset_read || !empty($actions)){?>

should work

 

regards


axxella

axxella
  • profile picture
  • Member

Posted 06 August 2013 - 20:50 PM

worked
thank you very much!


web-johnny

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

Posted 06 August 2013 - 20:55 PM

Guys this is pushed in the master branch so you will not have the same problem at the next release: https://github.com/scoumbourdis/grocery-crud/commit/5fc27c22129e6f1edc05146e2d3224ed8e634e39