在Grid上增加键盘监听事件
1 首先定义gridview id
onListsgridviewItemKeydown: function(dataview, record, item, index, e, eOpts) { var key = e.getKey(); var store = record.store; if(key>=e.A && key<=e.Z){ var initial = String.fromCharCode(key); var localIndex = index; do{ localIndex++; record = store.getAt(localIndex); }while(record && record.get('name').indexOf(initial.toLowerCase()) !== 0 && localIndex<=store.data.length-1); if(record && record.get('name').indexOf(initial.toLowerCase()) === 0 && localIndex<=store.data.length-1){ dataview.select(localIndex); } } return false; },