Table with dropdown combobox

Hi,

I have a table that show downtime and one of the field is an equipmentID so I would like to have a dropdown that would show all the value in the euipement table but insert only the ID in my downtime table.

Is this possible and how. thanks

So you have a table containing downtime information indexed by EquipmentId, and you want to filter the contents of this table using a combobox populated with equipment?

Combobox Databinding:

SELECT EquipmentId, EquipmentName FROM tbl_Downtime;

Table Databinding:

SELECT * FROM tbl_Downtime WHERE EquipmentId={SomePath.ToThe.Combobox.selectedValue};

Hi,

I wasnt clear enough. What I want its a combobox cell inside the Table like you see in most of the web base table.
So when you click on the field its a combobox field link to a sql select command not a text field.

I hope this will clarify my question. 

Thanks

Can’t do it with a table. You’d have to roll your own “faux” table.

I had posted something sort of similar… gimme a moment

EDIT: Found it!

[quote=“kevinmarchand@bc.com”]Hi,

I have a table that show downtime and one of the field is an equipmentID so I would like to have a dropdown that would show all the value in the euipement table but insert only the ID in my downtime table.

Is this possible and how. thanks[/quote]

I think I know what you are asking for, an editable field on a table that has a dropdown list for selections?

Right now that can be hard coded using the translate Map in the table customizer for the particular column you are after. This generated an html string that is stored in the table’s column attribute dataset.
Would be nice if this translate map could be bound to something.




You can make the translate map dynamic by binding the “Column Attributes Data” dataset to a “Cell Update” binding. With that you can dynamically change the translateMap column for the appropriate row. The map is just an xml like string that you can generate on a dynamic property.

I know it is a little hacky but it works. :slight_smile:

Hi Travis,

Since the bit hacky complexy thing would you be generous enough to post a attachement with an example of this strategy.

thanks

Ok, I have made a small example. I made the example in Ignition 7.4 rc2 (b841) so you can only import the attachment in that version or newer.

The attachment is a backup made from the Ignition designer. So you can open your designer and right click on Windows in the Project Browser to select Import… From there select the .proj file attachment and it will import the window.

The window just has a table. The table’s data can be bound to whatever you want. The table has two special custom properties (dynamic properties):

translateData
translateStr

The translateData is all of the data you want to show up in the mapping. It needs to be bound to a SQL query to get the mapping from the database. Once the translateData property changes there is a propertyChange script (event handler) on the table that loops through the data creating a translateStr like this:

1Display

Finally the column attributes data property is bound to a cell update binding where the appropriate column’s map comes from the translateStr.

Like I said, a bit hacky but it works.

Table Translate Map.proj (32.7 KB)

1 Like

Thanks Travis.

Used it and it works!

Had to ensure query for data to translateData was not Polling OFF so that the event trigger would work.

Right, good catch. The query on the translateData property should be polling off.

Why can not I download the proj file?

3 Likes

@Travis.Cox, I was trying to use the same function but can’t download the project because of either private thread or something else ! Can you post it again on a separate thread please ?

I have no idea why that link is broken and I wasn’t able to find the existing project export. So, I re-created it in Ignition 8.0.7:

TranslateTableExample_2019-12-11_1515.zip (11.5 KB)

Of course, you need 8.0.7 but the same principle applies to older versions. Just open it in the latest vesrion to see how it was put together. Let me know if there are questions.

2 Likes

Hi,

Any videos available on this?
One more requirement I want is,
1.How to put checkbox in this dropdown(multiple selection)
2.how to put link in table.

Vision has 2 different table components: Table and Power Table. The example above is using the Table component. The component provides a way to change how the columns appear. See this link for more details:

https://docs.inductiveautomation.com/display/DOC81/Vision+-+Table+Customizer

The example above simply adds in a Translation List.

The Power Table offers more flexibility to change how the table looks, especially with the editors. See this page for more details:

https://docs.inductiveautomation.com/display/DOC81/Vision+-+Power+Table

See the configureCell and configureEditor scripting extension functions.

1 Like