I am trying to add rows for search/filter requirement. There are 100s of fields to filter. Do my boss decided to keep them in a dropdown (here in this example I kept Manager, City and Name). When user selects one from the drop down, (lets say, City), the next box should display another drop down with all cities. If user selects Name, the next box should display a Text Box. And user can add as many rows (filters).
I tried and was able to dynamic add rows and display text box or drop down (based on inputType). But my problem is when I change from manager to Name, then it changes all boxes in right side to Text box. And when Add a new row/filer, it automatically displays previous selected drop down or Test. That means what I want is the right side dropdown or text box should appear only when user selects a value from the left side.
I am not sure I am explaining it well or not. But please feel free to ask questions.
Below is the example I have done so far. Thanks in advance for your help!
[AFTER MAKING CHANGES AS PER BELOW ANSWER] Thanks to @Nick Felker for quick answer.
Now I am able to add and delete rows. I want o get the key/value pair in JSON format. I am getting. but not getting the selected values fro the drop down fields. I am adding a new image and new stackblitz
Any help please.
Via Active questions tagged javascript - Stack Overflow https://ift.tt/rey8tLS
Comments
Post a Comment