In my dashboard, I have two different tables that share the exact same columns but are populated based on different query conditions. When I click on a row in the table, I want a modal to open up with a form that lets you edit the fields of the selected row from that table. Currently, I have two different modals, one for each table, but they have the exact same form on them. The only different is that they have different datasources (each one has its respective table).
Is there a way to have just one modal for both of these tables to share it?
You could just make the columns editable in each table...
or you can check the selectedIndex or selectedRow length when opening the modal and based on which table has a selectedIndex or selectedRow length > 0, that's what you can use. YOu can check using a ternary condition
If all fields are the same in the form, you can take the selected row value and store it in a temp variable and then read the temp variable into the form. You can use the Row select change event handler to populate the temp variable for either table...