Hello, I am trying to create a table of our production lines with the subview being the machines under the line.Is there a way to property bind these and what is the most efficient way to do?
I think I have an idea of what you're asking, but you're probably gonna need to provide more information...
Go ahead what is your question?
I feel like it is the responsibility of the OP (you) to post as much information as possible and then other users ask clarifying questions... Your question is very broad and doesn't have much to do with the picture you posted, you gotta be a little more specific. Anyway, here are some questions, since you asked...
What I understood from the question as it stands is that you have a table and then a subview in the table, which I can see from the screenshot. Where and what are you trying to bind? The subview to a value that is coming from a Table row? Something else? Is your subview another Table?
It does seem like there's some confusion here. There is no "binding" of subview data - the subview receives all of the information contained within the row. If you need that subview to have information regarding machines for a line, you either need to supply the machines as a column of the row data (though that column does not need to be displayed), or you need to supply enough information in the columns of the row that the machines can be obtained through something like a query.
For example, if your row is a production line, I'll pretend your data is something like this:
[
{
"Area": "Packaging",
"MachinesQty": 7,
"Parent": "L32",
"Product": null,
"StatusBar": "value",
"ValueStream": "OSD"
}
]
You would need to change the data structure to something like one of these structures:
# This example provides the row with all of the machines for this line.
# The 'Machines' column does not have to be displayed within the Table -
# you just need the data to be present in the row. The View being used
# for the subview should expect a param of `Machines` as an array.
[
{
"Area": "Packaging",
"MachinesQty": 7,
"Parent": "L32",
"Product": null,
"StatusBar": "value",
"ValueStream": "OSD",
"Machines": [
{
"id": 1
}
{
"id": 2
}
]
}
]
Alternatively, you could just supply the View being used for the subview enough information that it could query for the machines itself:
[
{
"Area": "Packaging",
"MachinesQty": 7,
"Parent": "L32",
"Product": null,
"StatusBar": "value",
"ValueStream": "OSD",
"ProdLineId": 1
}
]
Then you can have a query which pulls all machine IDs for the line based on the ProdLineId
param received from the row data.
Hello all, Ricardo from IA support was able to find us a number of solutions, currently we are using the quickest solution for calling the correct sub view rows. Wanted to share here in case anyone else is looking for similar solution.
Concept:
- In the main table, each row is a manufacturing line.
- In the sub view table, each row is a machine on the line. (In the simple case we used to get this working, our sub view table is going to be a very large table. ex. 3-7 machines per manufacturing line and approx. 30 lines.)
On the Main table props under 'rows':
- Just need to enable subview and point to your subview path table.
In your subview table properties under 'filter':
- enabled - true
- Configure a property binding to the 'text' field -'view.params.value.LineID'
-The perspective view housing the subview table has a PARAMS value added with
key name 'LineID' - After confirmed it is working like expected, under the style props you can add:
-'display:none' in order to hide the filter textfield.
Now after following the breadcrumbs and trying to write it up, I can't figure out how when you click on the main row drop down it is passing the LineID data into the subview filter. I can't find any extra bindings or event scripts. Any ideas?
This was done in Ignition Platform 8.1.20
.
See below:
So your Table data contains a column with a name of LineID
. When the subview receives the params from the row, every column of the row is present in params.value
, but the most important one for your setup is LineID
.