网格实时搜索extjs

时间:2016-10-13 12:57:41

标签: javascript search extjs highlight

我的实时搜索网格works fine但是当我点击下一页或对网格做其他事情时,搜索网格会丢失突出显示字词搜索,是否有人帮助我该怎么办?我想在所有页面中保持突出显示的术语搜索。感谢

下面是我的代码片段:

var pagingStore = Ext.create('Ext.data.Store', {
    proxy: {
        type: 'memory',
        enablePaging: true
    },
    remoteFilter: true,
    pageSize: 5
}),
        remoteStore = Ext.create('Ext.data.Store', {
            autoLoad: true,
            proxy: {
                type: 'ajax',
                url: 'js/json/pagingStore.json',
                reader: {
                    rootProperty: 'items'
                }
            },
            fields: ['name', 'email', 'phone', 'type']
        });
remoteStore.load(function () {
    pagingStore.getProxy().setData(remoteStore.getRange());
    pagingStore.load();
});
var bbar = new Ext.PagingToolbar({
    store: pagingStore, //the store you use in your grid
    displayInfo: true,
    items: [ {
            xtype: 'textfield',
            name: 'searchField',
            id: 'txtfield',
            fieldLabel:'Search:',
            labelAlign:'right',
            emptyText:'search...',
            width: 300,
            listeners: {
                change: {
                    fn: onTextFieldChange
                }
            }
        }
    ]
});
bbar.down('#refresh').hide();
Ext.create('Ext.grid.Panel', {
    height: 400,
    title: 'Simpsons',
    id: 'gridPanel',
    store: pagingStore,
    columns: [{
            text: 'Name',
            dataIndex: 'name',
            filterable: true
        }, {
            text: 'Email',
            dataIndex: 'email'
        }, {
            text: 'Phone',
            dataIndex: 'phone'
        },
        {
            text: 'Type',
            dataIndex: 'type'
        }],
    bbar: bbar,
    renderTo: Ext.getBody()
});

0 个答案:

没有答案