⚠ 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. ⚠


1.4 view button

action 1.4 view button

  • Please log in to reply
10 replies to this topic

#1 thaMink

thaMink

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 29 July 2013 - 10: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.

 



#2 davidoster

davidoster

    Grocery CRUD Ninja

  • Advanced Member
  • PipPipPip
  • 1,068 posts

Posted 30 July 2013 - 02:06 AM

Hello and welcome to the forums 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);
}


#3 thaMink

thaMink

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 31 July 2013 - 06:53 PM

Super.  Thanks for the reply.



#4 kenshicu

kenshicu

    Advanced Member

  • Members
  • PipPipPip
  • 85 posts

Posted 01 August 2013 - 01:32 PM

good,

 

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

 

http://www.grocerycr...tions_functions



#5 axxella

axxella

    Newbie

  • Members
  • Pip
  • 4 posts

Posted 05 August 2013 - 09:46 PM

how to make the button only displays the operation view?

thanks

 



#6 davidoster

davidoster

    Grocery CRUD Ninja

  • Advanced Member
  • PipPipPip
  • 1,068 posts

Posted 05 August 2013 - 10:44 PM

Hello and welcome to the forums axxella.

Use the unset_add, the unset_delete and unset_edit.



#7 axxella

axxella

    Newbie

  • Members
  • Pip
  • 4 posts

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.



#8 axxella

axxella

    Newbie

  • Members
  • Pip
  • 4 posts

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.



#9 superdan

superdan

    Advanced Member

  • Members
  • PipPipPip
  • 41 posts

Posted 06 August 2013 - 03: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



#10 axxella

axxella

    Newbie

  • Members
  • Pip
  • 4 posts

Posted 06 August 2013 - 08:50 PM

worked
thank you very much!



#11 web-johnny

web-johnny

    grocery CRUD Author

  • Administrators
  • 1,166 posts

Posted 06 August 2013 - 08: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/s...d3224ed8e634e39







Also tagged with one or more of these keywords: action, 1.4, view button

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users