notes-column

Questionsnotes-column
Shannon DeWitt asked 3 years ago

I have a column for notes. I don\’t want to show it in the grid but I do want the user to know there are notes. Any way to show and * orĀ  Yes instead of the note until they open it window to edit. This way they know something is in the field. I can just make the field small but it looks with only the first word showing.

1 Answers
Abu Ghufran Staff answered 3 years ago

You can have a new column alias in the grid that will be readonly and shown only on listing for Yes / No. e.g.

$g->select_command = "SELECT ...., IF(LENGTH(note) > 0, 'Yes', 'No') as HasNotes ... FROM table";

And in column definition,

$col["name"] = "HasNotes";
$col["title"] = "Notes";
$col["editable"] = false;
$col["show"] = array("list"=>true, "edit"=>false, "add"=>false, "view"=>false);
$cols[] = $col;

And for the original Notes columns, you can hide it on listing:

$col["name"] = "Notes";
$col["show"] = array("list"=>false, "edit"=>true, "add"=>true, "view"=>true);

Hope it help.

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Shannon DeWitt replied 3 years ago

This worked great, Thanks!

Your Answer

14 + 1 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?