2012-05-09 42 views
1

我工作的一個ExtJS門戶例子,從extjs4-mvc-portal on GitHub下載的例子中數據網格。ExtJS的livesearchpanel爲ExtJS的門戶

我已經成功地在Eclipse與Tomcat和添加XML網格面板。我想添加一個「livesearchpanel」 similar to this Live Search Grid Example

這個例子是在像商店,portlet的不同部分分開,我很困惑在哪裏添加CSS文件和JavaScript文件整合livesearchpanel。

當我在portlet中添加部分發生下列錯誤

無法加載資源:服務器與404(未找到)狀態

Ext.define('ExtMVC.view.portlet.livegrid', { 
    extend: 'Ext.ux.LiveSearchGridPanel', 
    alias: 'widget.livegrid', 

height: 300, 

/** 
* Custom function used for column renderer 
* @param {Object} val 
*/ 
change: function(val) { 
    if (val > 0) { 
     return '<span style="color:green;">' + val + '</span>'; 
    } else if (val < 0) { 
     return '<span style="color:red;">' + val + '</span>'; 
    } 
    return val; 
}, 

/** 
* Custom function used for column renderer 
* @param {Object} val 
*/ 
pctChange: function(val) { 
    if (val > 0) { 
     return '<span style="color:green;">' + val + '%</span>'; 
    } else if (val < 0) { 
     return '<span style="color:red;">' + val + '%</span>'; 
    } 
    return val; 
}, 

initComponent: function(){ 

    var store = Ext.create('ExtMVC.store.lives'); 

    Ext.apply(this, { 
     height: this.height, 
     store: store, 
     stripeRows: true, 
     columnLines: true, 
     columns: [{ 
      text  : 'Company', 
      flex  : 1, 
      sortable : false, 
      dataIndex: 'company' 
     }, 
     { 
      text  : 'Price', 
      width : 75, 
      sortable : true, 
      renderer : 'usMoney', 
      dataIndex: 'price' 
     }, 
     { 
      text  : 'Change', 
      width : 75, 
      sortable : true, 
      dataIndex: 'change', 
      // renderer: change 
     }, 
     { 
      text  : '% Change', 
      width : 75, 
      sortable : true, 
      dataIndex: 'pctChange', 
      //renderer: pctChange 
     }, 
     { 
      xtype : 'datecolumn', 
      text  : 'Last Updated', 
      width : 85, 
      sortable : true, 
      dataIndex: 'lastChange' 
     }] 
    }); 

    this.callParent(arguments); 
    } 
}); 

我已迴應在ExtJS的/ SRC /網格/ SRC的部分試圖EXT.ux.LiveSearchGridPanel.js,更改extend: 'Ext.grid.LiveSearchGridPanel',也`延伸: 'Ext.grid.Ext.ux.LiveSearchGridPanel',

回答

0

好問題就解決了.......... 中的ExtJS/src目錄,我只是參與UX文件夾。

謝謝