How do I conditionally show or hide fields on a Layout in Filemaker 14 Advanced? - database

I'm new to creating Layouts in Filemaker (I'm not using the latest version; am using Filemaker 14 Advanced instead), and I need to know: How can I conditionally/programmatically hide and show drop-down menus on the Layout, based on a selection in another drop-down menu? For instance: Let's say I have a drop-down menu called "Race," and it has three selections: "Human, Vampire, Werewolf." If I choose "Human," I want another drop-down menu called "Class" to appear; if I choose "Vampire," I want a different drop-down menu, called "Clans," to appear instead; if I choose Werewolf, then I want a drop-down menu called "Tribes" to appear. How can I engineer this using Filemaker's built-in language, or is there some other way to do it? Step-by-step instructions and/or code, please; like I said, I'm really, really new to this and to databases in general. Thanks!

You can conditionally hide layout objects by putting a calculation in the Hide Object When blank in the Behavior section of the Data tab on the Inspector palette.
That said, there are relational ways to have your dropdowns change their contents based selections in other fields. That is a lot more flexible, but (of course) more complex. What you want to set up is called a Dynamic Value list and is based on the values in a related table, filtered by the choices you made in the previous fields.

The calculation basically boiled down to just a single "equals" statement, or a bunch of them, simply singling out the value that would need to be selected in order to hide the layout objects I wanted hidden. Thanks for the help, guys! :-)

In my case, I wanted the new dropdown menus to stay shown even if many options were chosen in the first menu. I used the Pattern Count function (https://fmhelp.filemaker.com/help/10/fmp/en/html/func_ref3.33.73.html) to specify that if the answer to the last dropdown menu contained this optioned checked, the new menu would be shown by writing the following : Not PatternCount(table::variable;"text in one of the options")

Related

When should I use Lists vs Menus in Material-UI?

I'm having trouble figuring out the difference between Lists and Menus in Material-UI.
Docs
Lists - https://material-ui-next.com/demos/lists/
Menus - https://material-ui-next.com/demos/menus/
Description
My thinking is that Menus are used for routing and navigation while Lists are used for configuration or static content, but then I saw these quotes:
Menus appear upon interaction with a button, action, or other control. They display a list of choices, with one choice per line.
Reading this, Menus aren't intended to always show, they're designed to be hidden and only shown temporarily.
Menus should not be used as a primary method for navigation within an app.
This makes it seem like a sidebar with a list of navigation elements should be a List. If so, what if I take the same component and want to also use it in a dropdown menu? Do I have to make a separate component using Menu components?
Question
Since the docs are unclear to me, what instances would I want to use Menus vs Lists?
These components follow the Material Design standards, so their intended use would follow the standards.
For Menu:
Menus display a list of choices on a transient sheet of material.
For List:
Lists present multiple line items vertically as a single continuous element.
So while they're similar, I think the key difference is that Menu is intended for a transient selection, presented within something like a Dialog or Modal.

ag-grid : show the hidden columns (that were dragged out)

I have an ag-grid (free reactjs version) with lots of columns and records to load.
Some columns are not necessary, so the user can drag the columns out of the grid (and hence hide them). This is fine but how can the user show the hidden columns again without refreshing the page?
I don't want to suppress column drag, just a way to undo the hide without refreshing.
Any advice?
Shameless plug: The enterprise version has this feature in two places, Tool Panel and Column Menu.
However, thankfully it is rather easy to implement this feature yourself using a single columnApi call, well... one of these:
resetColumnState()
This will reset the state of the columns to what you initially defined them as. It will basically make everything visible again
setColumnVisible(colKey, visible)
Just pass in the colId of the column (usually what you passed in as 'field'... but it could be different depending on your set up) and a truthy or falsey value and this will show/hide the column
setColumnsVisible(<Array> colKeys, visible)
note the s - other than that it is the same as before, but you provide an array of colKeys that you want to all be hidden or shown. If you wanted to provide an array of all your columns with another array of whether they should be shown or not then use the last option here setColumnState
setColumnState(<Array> columnState)
This is probably overkill for what you are trying to do, but this will allow you to set the state of all the columns, whether they are visible or not, pinned to different sides, fixing the widths, etc.
Basically I can see you doing one of two things:
Create a button that will make all the columns visible and call gridOptions.columnApi.resetColumnState() when it is clicked
-- OR --
Create a list of check boxes that will listen for a change and call one of the other functions. This list could be outside of your grid, or even inside of your grid in a Custom Filter Component (find the athlete column of the first example to see what I mean.)

2sxc Dnn.. Add existing content items to module

I have a view of entities which are being displayed based on an entity type filter. I now need to reorder these and would like to use the built in 2sxc functionality to do this, so I have a created a new view of the data using the "module data source" so that the ordering will work.
But how do I now make all of the existing entities of the same type (definition) appear in this new view? The view now displays one item by default and I can replace that one item. But how do I add multiple existing items? I need the Entity ID's to remain the same for Query String usage and SEO.
Thanks, hope the question makes sense.
Cheers
I believe that you are asking "how can I add many items to an instance (module) manually, so that I can also sort them manually" - is this correct?
If yes, then you must make sure your template supports lists (checkbox in the template settings). This then gives you a [+] button; but you don't want to use that, as it would be for typing in new data. There's another button called "add an empty demo entry" which you'll see as a round (+) after pressing the more ... button once. Pressing this will give you empty entries, into which you can then replace existing items.

Conditional Formatting based on layout view

Another question for you Filemaker Pro experts. The database I am developing starts with a Main layout with a number of buttons (e.g. insert new item, show all items, etc.). Each button is associated to a script, which takes the user to the relevant layout. In each of these layouts I show the buttons in a row, and highlight the current layout with inverse colour.
My problem is that some of the buttons lead to the same layout, viewed in different modes, and I don't know how to conditionally highlight the right button.
For instance, Insert new item and Show all items take to the same layout, however in the first case the script views the layout as a form and inserts a new record, while in the second I view as a list and show all records. The layout is the same, though, so I'd need to enact a conditional formatting based on something. How do I do that, and what should I check against?
Thanks in advance for any help.
Regards.
Presumably you are currently using the formula: Get (LayoutName) to decide on your conditional formula, why not try additionally using formulas: Get(WindowMode) and Get(LayoutViewState)?
You could conditionally format the button if (which sends user to MyLayout in browse mode):
Get(WindowMode)=0 and Get(LayoutName)="MyLayout"
Or (which sends user to MyLayout in form view):
Get(LayoutViewState)=0 and Get(LayoutName)="MyLayout"
.
Other functions which may help could be Get(FoundCount) and Get(TotalRecordCount). You can see the entire list of Get functions here.

ExtJS - Nested Window/FormPanel

This is sort of a subjective question, but I'd like to get some ideas on the best way to lay this out. I'll set up the situation for you.
I have a grid with a column that allows the user to "View Details" on a particular item. The grid also allows the user to select multiple rows and "View Details" on those items. When the user clicks "View Details", a Window will pop over the grid, with a form inside it and controls to navigate between the multiple items (if they selected multiple items).
Here's a picture for an example:
I have no problem creating the Window, but I'm curious as to how to handle multiple "FormPanels", if that makes sense? Would I need to create another Panel inside the container Panel for each item they have selected, and then hide/show based on the active item (shown as "Item #1" in the dropdown)?
I'm thinking of it like a deck of cards in which you can navigate through, but I've never done something like this before. Also note that each item/card will be prepopulated with information from the grid, but that should be easy enough to do if I'm using the same Store.
Thoughts?
Yes you're right, and the layout you're looking for is the CardLayout.
You can read about it in the API here. The basic idea is like you said, a stack of cards that contain components, and you shuffle through them by calling the relevant methods.

Resources