Hi Johnny,
Sorry - a couple more questions for you …
Question #1a:
In the Datagrid, there is the option for “Quick Search” at the top of each column.
For varchar type of data, it appears to be doing a ‘contains’ type of match.
For example, the search string of “OL” will match “wolfe”
However, when the field is a number, it appears to require an exact match.
For example: if the datafield is “323323”, it will only match on “323323” and not a substring (e.g. “23”).
I thought perhaps changing that field to be a “string” in grocerycrud would change the behavior.
So, I tried something like:
$crud->fieldTypeSearchColumn(‘PatriotID’, ‘text’);
but the behavior didn’t change at all.
The filter menu option allows for searching based on ‘contains’ and that does what I expected, but I was hoping to see that work as a part of the Quick Search options on the columns.
Is there an option to do that, or do I need to cast the data into a different data type or something?
(this was something that worked in GCv1, but finding the behavior change in v3)
Question 1b …for a column that utilizes a callback to display the contents, is there any way to make that content searchable via the Quick Search option as well? Even exact matches aren’t filtering as matches.
Question #2:
When looking at the Read (clicking the view button), longer text fields are abbreviated and display an ‘eye’ icon to reveal the multi-line data. Is there perhaps a config option to have those always expanded vs requiring the user to click on them?
The 1st one didn’t work as I expected, but I can work around it with some DB views and make the issue resolved.
I know at one point, you had mentioned changing the behavior of the Action buttons so that custom buttons would be listed prior to the default ones…but that isn’t in there at this point. I was thinking I could do something like unsetRead() to make that button disappear, and then re-initialize it as a custom action, however, unsetRead() also disables the “read” state of grocerycrud, so I get a permission error on the custom action button. I understand why it works like that, just thought I could cleverly work around it.
I haven’t gone looking at the code yet to see where those buttons get defined to the render, but just thought I’d see about adding either putting custom buttons first, or the ability to set the order of the buttons, or perhaps even just an option to the unset*() options to do a “soft unset” where the button is gone but the code is still enabled if the URL is leveraged.
That’s weird that the first option didn’t work for you. I’ve tested locally and it works as expected.
For the read button, maybe a work-around to hide it with CSS? Is that a good enough option? If so it would be better to have more buttons in the configuration for example:
Thanks for the CSS tip.
That works…a bit more complicated since I replace the View button with another View button and the titles are the same, but the concept was enough to get me to what I needed…thanks!