I am creating a program with python that takes a CSV file, filters it and shows it to the user as a filtered file. That works great, but I have a problem when I want to implement dropdown menus for my table.
I used to_html()
and <div class="table-responsive">{{data| safe}} </div>
to import the file on the html side as a table.
I used javascript/jquery to implement the add/remove buttons, search box. What I can't figure out is how to add dropdown menus, since my table is not shown with HTML tags and each time has a different number of rows.
I have 23 columns and only 3 of them should have dropdown menus from which the user should choose a value for each row.
I created a fiddle to show how it looks currently. Bear in mind that here I just hardcoded my table for the example.- I did insert the class and id for the table on the python side so I can access the inputs in the table.
https://jsfiddle.net/2gw09vpr/1/
Currently, I added an attribute contendEditable
for the columns 4,5 and 6 where there should be a dropdown list to choose from. How can I do that?
I am new to python/jquery/js so I am lost on how to do it. What I tried so far was similar to this:
And nothing works for me. Any help would be appreciated.