Extjs.panel.Panel賦值的問題


初學extjs,很是不爽。也是只有初學者才犯的錯誤,發出來以免再犯。

先創建一個panel

  var panel1 = Ext.create('Ext.panel.Panel', {
                id: 'p1',
                autoScroll: true
                
            });

但是我要在Ext.grid.Panel中使用它,雙擊選中行並賦值給上面的這個panel.

var maGrid = Ext.create("Ext.grid.Panel", {
                store: Ext.data.StoreManager.lookup("evidenceIdentificationStore"),
                columns: {
                    items: [
                           { text: '鑒定科目', dataIndex: 'ISubject' },
                           { text: '案件名稱', dataIndex: 'CName' },
                           { text: '物證名稱', dataIndex: 'EName' }
                    ],
                    defaults: {}
                },
            
                stripeRows: true,//斑馬線效果
                forceFit: false,
                layout: 'fit',
                enableLocking: true
            });

雙擊上述的選中行

    maGrid.on("itemdblclick", function (view, record, html, index, e, eObj) {
                Ext.Ajax.request({
                    url: "/controler/evidenceIdentification.ashx?operate=another&IId=" + record.get("IId")+"",
                    method: 'post',
                    success: function (response, options) {
                        var arr = [];
                        arr = Ext.decode(response.responseText);
                       // alert(arr);
                       // document.getElementById("p1").innerHTML = arr;這樣賦值沒有滾動條 
                      var tt =  Ext.getCmp('p1').body.update(arr);
                       // Ext.MessageBox.alert('成功', '從服務端獲取結果: ' + response.responseText);
                    },
                    failure: function (response, options) { Ext.MessageBox.alert('失敗', '請求超時或網絡故障,錯誤編號:' + response.status); }
                });
               
            });

以上只提供部分代碼


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM