ext4.2+ ext.grid.plugin.rowexpander لديه خطأ ، ولا يمكن تشغيل collapsebody و expedbody المضافة. راجعت الرمز المصدري المقابل لـ ext.grid.plugin.rowexpander ، ولم أضيف أحداث CollapSebody وتوسيع نطاق الأحداث. حتى لو تم إعادة كتابة أساليب init و togglerow لـ ext.grid.plugin.rowexpander وفقًا للطريقة عبر الإنترنت ، لا يمكن تشغيل أحداث CollapSebody وتوسيع نطاقها.
الحل: أضف أحداث CllapSebody وتوسيع نطاقها إلى كائن الشبكة ، ثم قم بتكوين هذين الحدثين للشبكة ، وفي الوقت نفسه ، أعد كتابة طريقة التبادل لـ ext.grid.plugin.rowexpander ، وتشغيل الحدثين التي تمت إضافتها بواسطة الشبكة.
رمز مصدر الاختبار كما يلي:
<! doctype html public "-// w3c // dtd xhtml 1.0 transitional // en" "http://www.w3 content = "text/html ؛ charset = gb2312"> <title> ext4.2+ ext.grid.plugin.rowexpander لا يمكن أن يؤدي إلى انهيار ، حل حدث توسيع </title> <link rel = "stylesheet" type = "text/css" href = "../../ css/css/ext-all. type = "text/javaScript" src = "../../ ext-all-debug.js"> </script> <script> ext.override (ext.grid.plugin.rowexpander ، {// overide to fire collapsebody & expedbody init: function (grid) "expedbody") ؛ // الحل الموجود في منتدى EXT ، بحيث لا يمكن إضافة الأحداث // شبكة تخزين كائن this.grid = grid this.grid.addevents ('collapsebody' ، 'expedbody') ؛ ext.fly (rownode ، '_rowexpander') ، nextbd = row.down (me.rowbodyTseLector ، true) ، iscollapsed = row.hascls (me.rowcollapscedcls) ، addorremovecls = isCollapsed؟ "removecls": 'addcls' ، ownerlock ، Rowheight ، Fireview ؛ // تعليق التخطيطات بسبب عرضين محتملان لهما تغيير الارتفاع Ext.SusPendLayouts () ؛ Row [addorremovecls] (me.rowCollapsedCls) ؛ ext.fly (nextbd) [addorremovecls] (me.rowbodyHiddencls) ؛ me.recordsexpanded [record.internalid] = isCollapsed ؛ view.refreshsize () ؛ // مزامنة ارتفاع وفئة الصف على الجانب المقفل if (me.grid.OwnerLockable) {ownerlock = me.grid.ownerlockable ؛ // fireview = OfferLock.getView () ؛ عرض = ownerlock.lockedgrid.view ؛ FireView = ownerlock.lockedgrid.view ؛ rowheight = row.getheight () ؛ . لضمان // ارتفاعات الصفوف على جانبي الشبكة هي نفسها ، علينا أن نضع // كلاهما. ROW.SETHEIGHT (isCollapsed؟ rowheight: '') ؛ row = ext.fly (view.getNode (rowidx) ، '_Rowexpander') ؛ ROW.SETHEIGHT (isCollapsed؟ rowheight: '') ؛ Row [addorremovecls] (me.rowCollapsedCls) ؛ view.refreshsize () ؛ } آخر {fireview = view ؛ } // الحدث المشغل من خلال الشبكة ، وليس عرض ذلك. grid.fireevent (iScollapsed؟ // COALESCE LATER OUT بسبب تغييرات حجم العرض Ext.Resumelayouts (TRUE) ؛ } ، ستر {name: 'RecordDate' ، type: 'string'} ،] ، data: [{filename: 'file 1' ، الغرفة: "غرفة المؤتمرات 1" ، recorddate: '2014-07-03'} ، {filename: 'file 2' 3 '، RecordDate:' 2014-07-03 '}] ، Autoload: True}) ؛ console.log ('ext.grid.plugin.rowexpander') ؛ renderto: ext.getbody () ، الأعمدة: [{text: "اسم الملف" ، المرن: 1 ، dataindex: 'filename'} ، {text: "conference room" ، dataindex: 'room'} ، {text: "records tonger" ، reconder: 300 ، الإضافات: Expander ، قابلة للطي: true ، animcollapse: false ، العنوان: "الصفوف الموسعة في شبكة قابلة للطي" ، iconcls: 'icon-grid'}) ؛}) ؛ </script> </head> <body id = "docbody"> </html>