PDA

View Full Version : Ext.ux.grid.GridFilters



westvovik
10 Mar 2011, 7:27 AM
Greetings

There was a problem with filters,
There is a button which creates Grid in tabPanel.

If already the table is created, the second forms without filters, they are more exact is as I have understood from fireBug but them simply it is not visible

Here my simple example

Extjs 3.3.1



<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251" />
<title id='title'>test</title>

<link rel="stylesheet" type="text/css" href="/ext/resources/css/ext-all.css">
<!-- стили для фильтров -->
<link rel="stylesheet" type="text/css" href="/ext/examples/ux/gridfilters/css/GridFilters.css" />
<link rel="stylesheet" type="text/css" href="/ext/examples/ux/gridfilters/css/RangeMenu.css" />



<script type="text/javascript" src="/ext/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="/ext/ext-all-debug.js"></script>

<!-- фильтры -->
<script type="text/javascript" src="/ext/examples/ux/gridfilters/GridFilters.js"></script>
<script type="text/javascript" src="/ext/examples/ux/gridfilters/filter/Filter.js"></script>
<script type="text/javascript" src="/ext/examples/ux/gridfilters/filter/StringFilter.js"></script>
<script type="text/javascript" src="/ext/examples/ux/gridfilters/filter/DateFilter.js"></script>
<script type="text/javascript" src="/ext/examples/ux/gridfilters/filter/ListFilter.js"></script>
<script type="text/javascript" src="/ext/examples/ux/gridfilters/filter/NumericFilter.js"></script>
<script type="text/javascript" src="/ext/examples/ux/gridfilters/filter/BooleanFilter.js"></script>
<!-- фильтры для таблицы -->
<script type="text/javascript" src="/ext/examples/ux/gridfilters/menu/RangeMenu.js"></script>
<script type="text/javascript" src="/ext/examples/ux/gridfilters/menu/ListMenu.js"></script>


</head>
<body>
<script>
Ext.onReady(function(){

var columns = [{header: "date", fixed: true, dataIndex: "date", xtype: "datecolumn", format: 'd-m-Y', sortable: true, width: 120}];

var transaction = {
xtype: 'grid',
closable: true,
title: 'grid',
store: [],
columns: columns,
plugins: [{ptype: 'gridfilters',filters:[{type: 'date', dataIndex: 'date'}]}],
};

var tabPanel = new Ext.TabPanel({
renderTo: Ext.getBody(),
activeTab: 0,
border: false,
minTabWidth: 115,
tabWidth: 'auto',
tbar: [{xtype: 'button', text: 'grid', handler: function() {tabPanel.add(transaction)}, scope: this}]
});

});
</script>
</body>
</html>

mike2406
29 Mar 2011, 1:07 PM
Hi

I have the same problem :(
Do you fixed that??

westvovik
31 Mar 2011, 10:50 PM
No, just waiting update! :((

if you solve, reply pls!

mike2406
19 Apr 2011, 8:20 AM
I fixed it by myself...thanks for all your support :)

Love this forum ...

westvovik
20 Apr 2011, 1:25 AM
Please put the solution to this problem

westvovik
4 May 2011, 1:50 AM
This is solution thanks for all



Ext.onReady(function(){

var columns = [{
header: "name",
fixed: true,
dataIndex: "name",
sortable: true,
width: 120
}];

var store = new Ext.data.ArrayStore({
fields: ['name'],
data: [['Vladimir'], ['Mary'], ['Jon']]
})

var transaction = {
xtype: 'grid',
closable: true,
title: 'grid',
store: store,
autoHeight: true,
columns: columns
};

var tabPanel = new Ext.TabPanel({
renderTo: Ext.getBody(),
activeTab: 0,
border: false,
minTabWidth: 115,
tabWidth: 'auto',
tbar: [{
xtype: 'button',
text: 'create tab with grid',
handler: function(){
transaction.plugins = [{
ptype: 'gridfilters',
local: true,
filters: [{
type: 'string',
dataIndex: 'name'
}]
}];
var tab = tabPanel.add(transaction);
tabPanel.setActiveTab(tab);
},
scope: this
}]
});

})