简体   繁体   English

extJs门户内的数据网格的extJs livesearchpanel

[英]extJs livesearchpanel for data grid inside the extJs portal

I am working on an Extjs portal example and downloaded the example from extjs4-mvc-portal on GitHub . 我正在研究一个Extjs门户示例,并从GitHub上的extjs4-mvc-portal下载了该示例。

I have successfully integrated in Eclipse with Tomcat and added XML grid panel. 我已成功将Tomcat与Eclipse集成在一起,并添加了XML网格面板。 I want to add a "livesearchpanel" similar to this Live Search Grid Example . 我想添加一个类似于此“实时搜索网格示例 ”的“ livesearchpanel”。

This example is split in different sections like store, portlet and I'm confused where to add the CSS files and JavaScript files to integrate livesearchpanel. 这个示例分为不同的部分,如store,portlet,我不知道在哪里添加CSS文件和JavaScript文件以集成livesearchpanel。

When I added in the portlet section the following error occurred 当我在portlet部分中添加以下错误时

Failed to load resource: the server responded with a status of 404 (Not Found) 加载资源失败:服务器响应状态为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);
  }
});

I've tried EXT.ux.LiveSearchGridPanel.js in src section of extjs/src/grid/, change extend: 'Ext.grid.LiveSearchGridPanel', also `extend: 'Ext.grid.Ext.ux.LiveSearchGridPanel', 我在extjs / src / grid /的src部分尝试了EXT.ux.LiveSearchGridPanel.js,更改extend: 'Ext.grid.LiveSearchGridPanel',还扩展了:'Ext.grid.Ext.ux.LiveSearchGridPanel',

Ok problem is solved.......... i just involved ux folder in to extjs/src. 好的问题已经解决了..........我只是将ux文件夹包含在extjs / src中。

thanks 谢谢

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM