나는 EditorGridPanel을 가지고 있으며, 그리드의 ColumnModel에는 TextField, ComboBox 및 CheckBox가 포함되어 있습니다. TextField 또는 ComboBox를 편집 한 후 편집 된 필드에 대한 세부 정보가 들어있는 "afteredit"이벤트가 시작됩니다. CheckBox 필드를 선택/선택 취소 할 때 어떤 CheckBox가 눌려 졌는지에 대한 세부 정보를 제공하는 이벤트가 없습니다.그리드의 CheckBox를 검사하여 세부 사항을 얻는 방법은 무엇입니까?
답변
선택 모델은 확인란의 열을 렌더링하여 그리드의 행을 선택하거나 선택 취소 할 수 있습니다.
확인란 선택 모델에서 리스너를 적용 해보십시오.
문서는 : Ext.selection.CheckboxModel-event-selectionchange
은 참조 : example
CheckboxSelectionModel에는 텍스트 헤더가 없으며 그리드 열의 특정 위치에 배치 할 수 없습니다. –
체크 박스 열 위치를 설정하려면'injectCheckbox : Number/Boolean/String'을 설정하십시오. http://docs.sencha.com/ext-js/4-0/#!/api/Ext.selection.CheckboxModel-cfg-injectCheckbox – MMT
extjs 2.2 사용 :/injectCheckbox 속성이 없습니다 –
이 Ext.ux.CheckColumn
에서 checkchange 이벤트를 사용합니다. RowIndex가 제공됩니다.
편집
는 2.2에 더 많은 발전을하고 있다면 당신이 업그레이드하는 것이 좋습니다 것입니다. 그러나 할 수 없다면 언제든지 덮어 쓰기를 추가하거나 Ext.ux.CheckColumn
을 확장하여 최신 버전 이벤트를 포함시킬 수 있습니다. 이 코드는 2.2와 호환되도록 조정해야하지만, 여기에 필요한 이벤트를 포함하는 재정의 예제가 있습니다. 2.2에 Ext.override
메서드가 있다면 잘 모르겠습니다. 귀하의 문서를 확인하십시오 (checkchange 코드는 4.1 API에서 바로 제공됩니다) :
Ext.override(Ext.ux.CheckChange, {
constructor: function() {
this.addEvents(
/**
* @event beforecheckchange
* Fires when before checked state of a row changes.
* The change may be vetoed by returning `false` from a listener.
* @param {Ext.ux.CheckColumn} this CheckColumn
* @param {Number} rowIndex The row index
* @param {Boolean} checked True if the box is to be checked
*/
'beforecheckchange',
/**
* @event checkchange
* Fires when the checked state of a row changes
* @param {Ext.ux.CheckColumn} this CheckColumn
* @param {Number} rowIndex The row index
* @param {Boolean} checked True if the box is now checked
*/
'checkchange'
);
this.callParent(arguments);
},
/**
* @private
* Process and refire events routed from the GridView's processEvent method.
*/
processEvent: function(type, view, cell, recordIndex, cellIndex, e) {
var me = this,
key = type === 'keydown' && e.getKey(),
mousedown = type == 'mousedown';
if (mousedown || (key == e.ENTER || key == e.SPACE)) {
var record = view.panel.store.getAt(recordIndex),
dataIndex = me.dataIndex,
checked = !record.get(dataIndex);
// Allow apps to hook beforecheckchange
if (me.fireEvent('beforecheckchange', me, recordIndex, checked) !== false) {
record.set(dataIndex, checked);
me.fireEvent('checkchange', me, recordIndex, checked);
// Mousedown on the now nonexistent cell causes the view to blur, so stop it continuing.
if (mousedown) {
e.stopEvent();
}
// Selection will not proceed after this because of the DOM update caused by the record modification
// Invoke the SelectionModel unless configured not to do so
if (!me.stopSelection) {
view.selModel.selectByPosition({
row: recordIndex,
column: cellIndex
});
}
// Prevent the view from propagating the event to the selection model - we have done that job.
return false;
} else {
// Prevent the view from propagating the event to the selection model if configured to do so.
return !me.stopSelection;
}
} else {
return me.callParent(arguments);
}
},
});
extjs 2.2를 사용하고 Ext.ux.CheckColumn에 "checkchange"이벤트가 없습니다. –
- 1. 로깅을위한 예외 예외 세부 사항을 얻는 방법?
- 2. 통합 스트림에 대한 기여 활동 세부 사항을 얻는 방법은 무엇입니까?
- 3. 신청서를 클릭하면 세부 사항을 표시하는 방법은 무엇입니까?
- 4. 디버거없이 예외 세부 사항을 얻는 방법?
- 5. 가상 컴퓨터에서 성능 세부 사항을 얻는 방법?
- 6. 페이스 북의 세부 사항을 얻는 것
- 7. 다음 시나리오에서 변경 사항을 얻는 방법은 무엇입니까?
- 8. C++을 사용하여 새로운 Edirectory 세부 사항을 얻는 방법
- 9. Apache 또는 PHP를 사용하여 forward_host 세부 정보를 얻는 방법은 무엇입니까?
- 10. mysql db에서 이미지를 포함한 직원 세부 사항을 저장하는 방법은 무엇입니까?
- 11. 사용자에게 세부 사항을 묻는 AsyncTask를 일시 중지하는 방법은 무엇입니까?
- 12. Hudson에게 git 저장소 변경 사항의 세부 사항을 표시하는 방법은 무엇입니까?
- 13. 바코드 용 코드를 구현하고 textview에 세부 사항을 지정하는 방법은 무엇입니까?
- 14. 이미 구성된 이클립스 프로젝트에 git 세부 사항을 얻는 방법
- 15. db2_exec()가 false를 리턴 할 때 오류의 세부 사항을 얻는 방법은 무엇입니까?
- 16. python hotshot 프로파일 링 모듈에서 메소드 호출 세부 사항을 얻는 방법은 무엇입니까?
- 17. 그리드의 이름을 찾는 방법은 무엇입니까?
- 18. 안드로이드의 ListView 항목에 CheckBox를 추가하는 방법은 무엇입니까?
- 19. ASPxGridView - 마스터 - 세부 GridView의 세부 그리드에서 선택된 행을 얻는 방법?
- 20. Clojure에서 데이터 구조 구현 세부 사항을 추상화
- 21. 그리드의 스타일에서 그리드의 자식 요소의 전경색을 설정하는 방법은 무엇입니까?
- 22. 레일즈는 ActiveRecord/ActiveModel없이 폼의 세부 사항을 기억합니다
- 23. CheckBox를 부울로 변환하는 방법?
- 24. Sharepoint 2010 클라이언트 개체 모델에서 변경 사항을 얻는 방법은 무엇입니까?
- 25. Windows에서 특정 파일 세부 정보를 얻는 방법은 무엇입니까?
- 26. Drupal에서 Facebook 연결을 사용하여 사용자 세부 정보를 얻는 방법은 무엇입니까?
- 27. BadgeVille API를 사용하여 사용자 세부 정보를 얻는 방법은 무엇입니까?
- 28. 로그 파일에서 오래된 로그 세부 정보를 얻는 방법은 무엇입니까?
- 29. 마스터 세부 정보 페이지의 컨트롤을 얻는 방법은 무엇입니까?
- 30. 안드로이드 용 mysql 데이터베이스의 세부 정보를 얻는 방법은 무엇입니까?
roweditor 또는 celleditor를 사용하고 계십니까? – Geronimo