Greetings All,
I am creating an on-line product configurator driven by data from an MRP system. The MRP has a "configurator" that lets you define questions, answers, and a matrix of "invalid" answers. When a question is answered, all of the following "invalid" questions and answers are removed. Sounds made-to-order for jQuery, and so far it is. My prototype is here:
The options I'm considering:
- placing a class on all of the "answer" divs for the associated prior answers that would remove them. This makes their selection and removal easy with jQuery. That is the approach of the current proto.
- storing all of the ID's slated for removal and the associated questions in an array. refer to the appropriate array element for processing as questions are answered with jQuery.
- pulling "invalid" information in as needed with AJAX as questions are answered.
My questions:
- what is the best approach? I'm wary of pulling with AJAX in the background as there will be 25+ questions and I don't want the customer waiting for data to arrive.
- is there a limit to how many classes you can put on an html element (div)?
- is there a limit to how many IDs you can place into a selector to be processed at once?
- is it better to iterate through 100 array elements, doing a jQuery function on each, or to place all of the IDs in one selector and having jQuery process them in one pass?
NOTE: I've found the "group_concat" function in MySQL to be a great tool in creating strings of classes or IDs to process from a DB. You can collapse multiple classes or IDs contained in individual records into groupings with one string for all. MySQL does all the heavy lifiting.
I know this is a long one. Thanks in advance for any advice. I'm excited about what I've learned of jQuery so far. It's also causing me to shed some old design approaches; good stuff.
Regards,
Patrick