need help with create button.

edited April 2013 in Modules
Hello,

In list view , I need to make create button disappear after there are 12 items in list. Create button should disappear in both list view and edit view of simple module. How can i do this?

Comments

  • edited 11:27AM
    That's not really supported out of the box so you may need to get creative. If you are using the 1.0 beta, one method may be to add javascript in your form_fields method that sets the display of the button to none.
    function form_fields($values = array(), $related = array()){ { $fields = parent::form_fields($values, $related); .... $num = $this->record_count(); if ($num > 12) { $fields['__FORM_BUILDER__']['js'] = '<script>$(function(){$('.ico_create').hide();})</script>'; } return $fields; }
Sign In or Register to comment.