1

Re: Replacing the comment field in a species checklist grid with a popup

The species checklist grid can get a bit squashed at times if you have a few columns in it. If you are using the prebuilt forms under Drupal, you can create a JavaScript file called node.x.js (replace x with the node ID of the page) and drop it into iform\client_helpers\prebuilt_forms\js

Put this script in it to replace the comment column with an icon which displays a popup:

jQuery(document).ready(function() {
  ConvertControlsToPopup($('.scComment'), 'Comment', Drupal.settings.basePath + 'sites/all/modules/iform/media/images/nuvola/package_editors-22px.png');
});

function hook_species_checklist_new_row(data) {
  var id='#sc:'+data.id+'::occurrence:comment';
  id = id.replace(/:/g, '\\:');
  ConvertControlsToPopup($(id), 'Comment', Drupal.settings.basePath + 'sites/all/modules/iform/media/images/nuvola/package_editors-22px.png');
}

You will also want to add the following css to hide the comment box initially. This can be done by creating a node.x.css file in the iform\client_helpers\prebuilt_forms\css folder:

scComment {
    display: none !important;
    width: 600px;
}
John van Breda
Biodiverse IT