prev/next design question

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

prev/next design question

Will
I'm trying to implement the Prev/Next function.

I did the Prev/Next for summary.

I did it on the client side.

So, in javascript, I keep an array of values and an index var, e.g.

   summary_values = [ "", "" ... ]
   summary_index

This is not too bad for a 1-dimensional array.

But then, next, I need to do the Prev/Next for each summary of many subsections.

This means it will be a 2-dimensional array.

Then, I need to do the Prev/Next for the for each bullet of many bullets of many subsections.

That will be a 3-dimensional array.

Please advise a better design to deal with this?
Reply | Threaded
Open this post in threaded view
|

Re: prev/next design question

fschmidt
Administrator
Since the values will come from lucene, the values may change.  This means the index may change and shouldn't be stored.  So you should calculate the index by iterating through the values and looking for a match.  So no need to store indexes.  You get the current value by parsing the HTML and the possible values from lucene (or dummy data for now).
Reply | Threaded
Open this post in threaded view
|

Re: prev/next design question

Will
Can we talk this over?
Reply | Threaded
Open this post in threaded view
|

Re: prev/next design question

fschmidt
Administrator
You can Skype me tomorrow.