首页 > 解决方案 > 在 EXTJS 3.2.1 中按文本过滤网格

问题描述

我有一个网格EXTJS。我需要添加文本框并通过文本来过滤网格。

这是我的网格:

Ext.onReady(function () {
    var reportsGrid = new Ext.grid.GridPanel({
        id: 'my-grid',

        cm: new Ext.grid.ColumnModel([{
            id: 'CourseId',
            dataIndex: 'CourseId',
            hidden: true
        }, {
            dataIndex: 'ActionCenterId',
            hidden: true
        }, {
            header: 'AAAAA',
            width: 115,
            sortable: true,
            ,
            dataIndex: 'NameCourse'
        }]),
        {
            header: 'BBBB',
            width: 100,
            sortable: true,
            dataIndex: 'ActionCenterName'
        },
        maxHeight: 350,
        autoHeight: true,
        width: 870,
        store: xmlStore,
        title: 'SEARCH'
    });

    reportsGrid.render('ext_grid_results');

    var xmlStore = new Ext.data.Store({
        url: "Services/course/courseService.aspx?serviceMethod=GetcourseDetails",
        reader: new Ext.data.XmlReader({
                record: 'Course',
                totalRecords: 'results'
            },
            record
        )
    });

    var record = Ext.data.Record.create([{
        name: 'CourseId',
        type: 'int'
    }, {
        name: 'ActionCenterId',
        type: 'int'
    }, {
        name: 'NameCourse',
        type: 'string'
    }]);
});

我想在标题文本框中添加,当我在文本框中键入字母时,它将过滤数据。请建议我,我怎样才能做到这一点。

提前致谢

标签: extjsgrid

解决方案


推荐阅读