dynamic event stack for excel-like input box?
Hey everyone..
I'm implementing an advanced search for my company where the user is building rules and all the options are coming dynamically from the database.
I have an input box where the user can type free text, or use available functions like in Excel. They can press the = key and I have an autocomplete attached that returns available functions. Then when they select one, a function could have n options, and I have an autocomplete for most of the parameters as well.
So, I'm dynamically binding and unbinding autocomplete handlers as well as keyup events to listen to things like a coma, so I know to attach the next parameter's autocomplete, etc...
Is there any structure/plugin/etc that exists where I could almost keep a stack of events. So the first autocomplete is bound, and pushed on the stack. When the function is selected, the next event is bound and added to the stack. Now when the user finishes the function and it closes or they enter the closing ) themselves, it pops off the stack and its now back at the original autocomplete...
Any thoughts or ideas would be greatly apprecitated! Thanks!