How to jump to row on key press?

Mar 30, 2009 at 3:01 PM

Hi,

I've recently added a Superlist control to my project which looks great and provides me with most of the functionality I need.

My issue is that I'm showing a list of contacts sorted by name and I would like to jump to the appropriate row when the user starts typing a name, similar to Outlook.

Does the control already provide this functionality?

If not, I suspect I need to use the control's key events to implement?  Any tips on implementation would be greatly appreciated.

Thanks

Alan

Coordinator
Mar 30, 2009 at 4:36 PM
<style> <!-- /* Font Definitions */ @font-face {font-family:"Cambria Math"; panose-1:2 4 5 3 5 4 6 3 2 4; mso-font-charset:1; mso-generic-font-family:roman; mso-font-format:other; mso-font-pitch:variable; mso-font-signature:0 0 0 0 0 0;} @font-face {font-family:Calibri; panose-1:2 15 5 2 2 2 4 3 2 4; mso-font-charset:0; mso-generic-font-family:swiss; mso-font-pitch:variable; mso-font-signature:-1610611985 1073750139 0 0 159 0;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-unhide:no; mso-style-qformat:yes; mso-style-parent:""; margin-top:0cm; margin-right:0cm; margin-bottom:10.0pt; margin-left:0cm; line-height:115%; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:Calibri; mso-fareast-theme-font:minor-latin; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi; mso-fareast-language:EN-US;} .MsoChpDefault {mso-style-type:export-only; mso-default-props:yes; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:Calibri; mso-fareast-theme-font:minor-latin; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi; mso-fareast-language:EN-US;} .MsoPapDefault {mso-style-type:export-only; margin-bottom:10.0pt; line-height:115%;} @page Section1 {size:595.3pt 841.9pt; margin:72.0pt 72.0pt 72.0pt 72.0pt; mso-header-margin:35.4pt; mso-footer-margin:35.4pt; mso-paper-source:0;} div.Section1 {page:Section1;} --> </style>

Glad the control seems to be working out for you. There's is no current way of being able to" jump to" a row based on some data - it could be done with a little digging around. How about reducing the list to matching rows as the user types, personally I like that way of working plus it would be easier to code with Superlist.

What you could do is run over your rows as each key is pressed firstly deleting any rows already in the list and then re-adding them based on some filter. Then see what mileage (speed wise ) you get from it with the sorts of data sets you are expecting. I would wait to do the search after the user has left typing in the search box for a predefined time like say 1 second or more. That way you would reduce the CPU load and possible jerkiness of operations.

Since the Superlist only updates (normally) when things are quite you should be able to just delete and re-add your rows with any flickering from the control.

 

HTH

Regards

Lee

Mar 31, 2009 at 8:29 AM

Superb, that's a much better solution than I was looking for!

I'll make a start on implementing, thanks for your help and speedy response.

Alan