Flags problem...becomes complicated


#1

Take a look at this `fiddle. It is a form I am building where the user enters services along with price visibility and the price itself....the user can add/remove/update a service.

So...I need to track the state of it....the following lines have code for that.
lines 69,100-114,131
Locally there is more code for that(in the fiddle you see a demo only)

And here starts the problem....it becomes too complicated to keep track the states.

Can you propose any alternative to the flag scheme or should I just stick to it with all it's pros and cons.


#2

Maybe look at React, where you build everything with components and all you need to do to update the DOM is to change your app's state. That might be a good answer to your jQuery spaghetti...


#3

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.