PDA

View Full Version : How to jump to row while typing in grid?



dbassett74
30 Sep 2009, 9:52 AM
Is there a way to specify that when a grid currently has focus, and the user starts typing, a certain column will be queried (in this case "Name") that will try to find a match and jump to it?

For example, I have a grid such as:

-----------------------------
| Name | Description
-----------------------------
| Joe Blow | Joe really blows!
-----------------------------
| Dan B | Really cool dude!
-----------------------------
| Danny B | Another cool dude!


So if grid has focus, and user types the letter D, it will jump to the second row. If he continues to type "Dan", it will remain on that row, but if the user types "Dann", it will jump down to row 3, in this case. An added bonus would be that it also dynamically highlights the matching letters as the user types, but not entirely necessary.

Any help on this would be appreciated.

dbassett74
30 Sep 2009, 10:37 AM
Okay, I think I'm on to something. I can use the store.find to jump to a row. I can just keep track of the last selected index, and use that as the start index. Pretty cool stuff! Now I just got to get the scrollIntoView to not scroll the row all the way to the top... :-?