ext4.2+ ext.grid.plugin.rowexpander에는 버그가 있으며 붕괴 바디 및 확장체 추가는 트리거 될 수 없습니다. ext.grid.plugin.rowexpander에 해당하는 소스 코드를 확인했으며 붕괴 및 Expandbody 이벤트를 추가하지 않았습니다. ext.grid.plugin.rowexpander의 init 및 토글 로우 방법이 온라인 방법에 따라 다시 작성 되더라도 Collapsebody 및 Expandbody 이벤트는 트리거 될 수 없습니다.
솔루션 : 붕괴 바디 및 확장 바디 이벤트를 그리드 객체에 추가 한 다음 그리드에 대한이 두 이벤트를 구성하고 동시에 ext.grid.plugin.rowexpander의 Togglerow 메소드를 다시 작성하고 그리드에 의해 추가 된 두 이벤트를 트리거합니다.
테스트 소스 코드는 다음과 같습니다.
<! doctype html public "-// w3c // dtd xhtml 1.0 Transitional // en" "http://www.w.w.org/tr/xhtml1/dtd/xhtml1-transitional.dtd예. content = "text/html; charset = gb2312"> <title> ext4.2+ ext.grid.plugin.rowexpander는 Collapsebody를 트리거 할 수 없으며 확장체 이벤트 솔루션 </title> <link rel = "Stylesheet"type = "text/css"href = "../ resources/css/ext-all.css"external nof "/>>>> css. type = "text/javaScript"src = "../../ ext-all-debug.js"> </script> <cript> ext.override (ext.grid.plugin.rowexpander, {// Fire Collapsebody & Extand Body init : grid) {this.callparent (hucallatuments); // grideview (). 'Expandbody'); // ext 포럼에서 발견 된 솔루션 이벤트를 추가 할 수 없도록 // 스토리지 그리드 객체 this.grid = grid this.grid.addevents ( 'collapsebody', 'expandbody'); // 이벤트 추가}, 토글 로우 : 함수 (rowidx, record) {var me = this, view, rownode = row. ext.fly (rownode, '_rowexpander'), nextbd = row.down (me.rowbodytrselector, true), iscollapsed = row.hascls (me.rowcollapsedcls), addorremovecls = iscollapsed? 'removecls': 'addcls', 소유자, Rowheight, fireview; // 높이 변경이있는 두 개의 뷰가 ext.suspendlayouts (); 행 ext.fly (nextbd) [addorRemoveCls] (me.rowbodyHiddenCls); me.recordsexpanded [record.internalid] = iscollapsed; view.refreshsize (); // 잠긴 쪽의 행의 높이와 클래스를 동기화합니다. View = olderlock.lockedgrid.view; fireview = olderlock.lockedgrid.view; rowheight = row.getheight (); // extjsiv-9848 : Firefox에서 행의 오프 테일이 일치하지 않을 수 있습니다. // 하위 픽셀 반올림 오류로 인해 실제로 높이가 렌더링됩니다. 그리드의 양쪽에있는 줄 높이가 동일하도록하려면 // 둘 다 설정해야합니다. row.setheight (iscollapsed? rowheight : ''); row = ext.fly (view.getNode (rowIdx), '_rowexpander'); row.setheight (iscollapsed? rowheight : ''); 행 view.refreshsize (); } else {fireView =보기; } // viewThis.grid.fireevent가 아닌 그리드를 통한 이벤트 트리거 (ISCOLLAPSED? 'ExpandBody': 'CollapseBody', row.dom, record, nextbd); // 다음은 ext 포럼에 대한 해결책입니다. // 크기 조회수로 인해 배치 된 Coalesce ext.ResumelAyouts (true); },}); // ext.loader.setConfig ({enabled : true}); ext.onready (function () {ext.quicktips.init (); var store = new ext.data.store ({fields : 'filename', type : 'string'}, {이름 : 'type', 'string'}, {name : 'recordDate', type : 'string'},], 데이터 : [{filename : 'file 1', room : '컨퍼런스 룸 1', 레코드 데이트 : '2014-07-03'}, {filename : '파일 2', 룸 : '컨퍼런스 룸', 레코드 데이트 : '2014-07-03'}, {filename : '컨퍼런스 3' 3 ', RecordDate :'2014-07-03 '}], autoload : true}); console.log ( 'ext.grid.plugin.rowexpander'); renderto : ext.getBody (), 열 : [{텍스트 : "파일 이름", flex : 1, dataindex : 'filename'}, {text : "conference room", dataindex : 'room'}, {텍스트 : "레코드 날짜", renderer : ext.util.format.daterenderer ( 'ym-d'), recorddate '}, 6 :', 60 : ' 300, 플러그인 : Expander, 붕괴 : true, animcollapse : false, title : '접을 수있는 그리드의 Expander 행', iconcls : 'icon-grid'});}); </script> </head> <body id = "docbody"> </body> </html>