2011-10-26 1 views
2

콤보 상자를 만들고 템플릿에 'qtip'속성을 삽입하여 퀵 팁을 삽입합니다 (예 : this 질문). QuickTips를 제외하고 모두 잘 작동합니다. 키보드로 탐색 콤보 박스 목록에 표시되지 않습니다.Extjs 키보드 선택시 콤보 상자의 퀵 팁

누구나 키보드로 콤보 목록을 탐색 할 때 어떻게 퀵 팁을 사용할 수 있는지 알고 있습니까? extjs-3.4.0을 사용하고 있습니다. 감사합니다.


내 콤보는 다음이 당신을 위해 자동으로 발생되지 않는 이유는 그래서

Ext.extend(Ext.form.ComboBox, { 
    tpl:'<tpl for="."><div ext:qtip="{tooltip}" class="x-combo-list-item">{item}</div></tpl>', 
    selectPrev:function() { 
     var ct = this.store.getCount(); 
     var idx = 0; 
     if (ct > 0) { 
      if (this.selectedIndex == -1) { 
       this.select(0); 
      } else if (this.selectedIndex !== 0) { 
       idx = this.selectedIndex - 1; 
       this.select(this.selectedIndex - 1); 
      } 
      var el = this.view.getNode(idx); 
      if (el) 
       eventFire(el, "mouseover"); 
     } 
    }, 
    selectNext:function() { 
     var ct = this.store.getCount(); 
     var idx = 0; 
     if (ct > 0) { 
      if (this.selectedIndex == -1) { 
       this.select(0); 
      } else if (this.selectedIndex < ct - 1) { 
       idx = this.selectedIndex + 1; 
       this.select(idx); 
      } 
      var el = this.view.getNode(idx); 
      if (el) 
       eventFire(el, "mouseover"); 
     } 
    }, 

    onViewOver:function (e, t) { 

     var item = this.view.findItemFromChild(t); 
     if (item) { 
      var index = this.view.indexOf(item); 
      this.select(index, false); 
     } 
    } 
}); 

답변

0

빠른 팁은 qtip를 배치하기 위해 마우스 이벤트를 사용합니다. 이 작업을 수행하기 위해 사용자 정의 코드를 작성해야 할 수도 있습니다.

나는 (혹은 콤보의 선택기로) 콤보에 대한 적절한 이벤트 리스너를 부착하고 당신이 그것을 원하는 qtip의 위치를 ​​Ext.Element 기능 (예를 들어, alignTo 혹은 getPosition)를 사용하려고합니다. QTip 관리자를 직접 사용할 수 없을 수도 있으며 사용자 지정 Ext.Tip을 만들어야 할 수도 있습니다.

자세한 내용이 필요하거나 붙어있어 몇 가지 추가 힌트를 원하면 알려주세요.

+0

당신 말이 맞아요. 해결책을 찾았습니다. 사용자 정의 ComboBox에서 selectNext 및 selectPrev 메서드를 재정의하고 'mouseover'이벤트를 끝에 발생시킵니다. 감사! – ice

+1

다음 사람이 다시 사용할 수 있도록 게시물을 편집하고 코드를 표시해야합니다. –