2014-07-09 87 views
1

我正在嘗試將過濾添加到簡單的ExtJS 5網格中。我正在使用安裝提供的一個簡單的例子,看起來它工作正常,除了在IE中,當我嘗試過濾所有記錄被擦除。ExtJS 5 IE9中的網格過濾和排序中斷

有沒有人看過這個問題?這是我正在使用的代碼。

`$( 「#SearchEmployees」)點擊(函數(){

var criteria = $("#employeeName").val(); 

if (criteria == '' || criteria == null) { 
    alert("Please apply search criteria."); 
    return; 
} 

var baseurl = $("#hdnUrlSearch").val(); 

var data = (function() { 

    $("#employeesSearchGrid").empty(); 

    $.ajax({ 
     type: "POST", 
     url: baseurl, 
     dataType: "json", 
     data: { employeeName: criteria }, 
     async: false 
    }).done(function (retData) { 
     data = retData; 
    }).fail(function (xhr) { 
     alert(xhr.responseText); 
    }); 

    return data; 
})(); 

Ext.define('EmployeeSearch', { 
    extend: 'Ext.data.Model', 
    fields: [ 
     'FullName', 
     'DepartmentName', 
     'PhoneNumber', 
     'EmailAddr' 
    ] 
}); 


var store = Ext.create('Ext.data.Store', { 
    model: 'EmployeeSearch', 
    proxy: { 
     type: 'ajax'   
    }, 
    data: data 
}); 

var grid = Ext.create('Ext.grid.Panel', { 
    store: store, 
    forceFit: true, 
    columns: [{ 
     header: 'Name', 
     dataIndex: 'FullName', 
     flex: 1, 
     filter: 'string', 
     width: 440 
    }, { 
     header: 'Department', 
     dataIndex: 'DepartmentName', 
     filter: 'string', 
     flex: 1, 
     width: 200 
    }, { 
     header: 'Direct Phone', 
     dataIndex: 'PhoneNumber', 
     filter: 'string', 
     flex: 1, 
     width: 240 
    }, { 
     header: 'Notification Email', 
     dataIndex: 'EmailAddr', 
     flex: 1, 
     filter: 'string' 
    }], 
    renderTo: 'employeesSearchGrid', 
    frame: true, 
    plugins: ['gridfilters'] 
}); 

});`

回答

1

的問題是固定的,加入電網的高度。一旦我做了過濾和排序得到修復。下面是我的網格現在的樣子:

var grid = Ext.create('Ext.grid.Panel', { 
    store: store,  
    columns: [{ 
     text: 'Name', 
     dataIndex: 'FullName',    
     flex: 1, 
     width: 440, 
     sortable: true, 
     filter: 'string' 
    }, { 
     text: 'Department', 
     dataIndex: 'DepartmentName', 
     flex: 1, 
     width: 200, 
     sortable: true, 
     filter: 'string' 
    }, { 
     text: 'Direct Phone', 
     dataIndex: 'PhoneNumber', 
     flex: 1, 
     width: 240, 
     sortable: true, 
     filter: 'string' 
    }, { 
     text: 'Notification Email', 
     dataIndex: 'EmailAddr', 
     flex: 1, 
     sortable: true, 
     filter: 'string' 
    }], 
    forceFit: true, 
    split: true, 
    renderTo: 'employeesSearchGrid', 
    height: 210, 
    frame: true, 
    plugins: ['gridfilters'] 
});