But then I also achieved similar results in a standard grid.
OnScriptInit:
//Color fields
?>
<link href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" rel=“stylesheet”>
<?php
OnRecord:
//Get count of records from files table
$check_sql = “SELECT count(*)”
. " FROM files"
. " WHERE parent_id = ‘" . {note_id} . "’";
sc_lookup(rs, $check_sql);
if (isset({rs[0][0]})) // Row found
{
$row_count = {rs[0][0]};
}
else // No row found
{
$row_count = ‘’;
}
//conditionally show paperclip on grid
if ($row_count >= 1) {
{img_attachments} = “<img src=’…/_lib/img/scriptcase__NM__ico__NM__paperclip_16.png’/>” ;
} else {
{img_attachments} = ‘’ ;
}
//Color Private
if({private} == “1” )
{
{private} = “<label class=‘label label-danger’>Private</label>”;
} else {
{private} = “<label class=‘label label-success’></label>”;
}
//Join all fields into one so that I can stack them
$check_sql = “SELECT name”
. " FROM people"
. " WHERE user_id = ‘" . {created_by_id} . "’";
sc_lookup(rs, $check_sql);
if (isset({rs[0][0]})) // Row found
{
$people_name = {rs[0][0]};
}
else // No row found
{
$people_name = ‘’;
}
{joined_fields} = “{note_id} Created {created_on} $people_name {img_attachments} {private} <br> {note}” ;
