-
Grid Filter Problem
While trying to use a filter in a grid, the following thing happened
the grid keeps on loading and following error comes
this.proxy is undefined
here is the code:
Code:
var filtersForAttrbuteGrid = new Ext.grid.GridFilters({
filters:[
{
type: 'string',
dataIndex: 'AttributeName'
},
{
type: 'list',
dataIndex: 'DataType',
options: attrDataList
},
{
type: 'list',
dataIndex: 'Range',
options: attrRangeList
},
{
type: 'list',
dataIndex: 'UseType',
options : attrSectionorUseList
},
{
type: 'list',
dataIndex: 'ApplicableFor',
options : attrApplicableList
}
]});
var pagingBar = new Ext.PagingToolbar({
id:'attr_pagingBar',
pageSize: attr_PageSize,
store: simpleStore,
displayInfo: true,
displayMsg: 'Displaying Attributes {0} - {1} of {2}',
paramNames:{
start:'start',
limit:'pageSize',
sort:'sort',
dir:'dir'
},
listeners:{
change : function(toolBar, event){
var startRowNum = (event.activePage - 1) * attr_PageSize;
//alert('startRowNum '+startRowNum);
renumberRows(simpleStore, startRowNum);
}
/*
beforechange : function(pagingToolBar, event){
//alert("Inside beforechange = "+event.start);
varstart = event.start;
}*/
},
plugins : filtersForAttrbuteGrid,
emptyMsg: "No Attribute to display"
});
var grid = new Ext.grid.GridPanel({
id:att_grid_panel_id,
ds: simpleStore,
cm: cm,
sm: new Ext.grid.RowSelectionModel({
singleSelect: true
}),
stripeRows: true,
viewConfig: {
forceFit: true
},
layout:'fit',
title: 'Attibute Editor',
loadMask: {msg: 'Loading ...'},
tbar : tBar,
bbar : pagingBar,
plugins : filtersForAttrbuteGrid
});
-
Is simpleStore filled with local data or remote data?
If it's local data, then GridFilters needs to be configured with local:true.
-
I am using a local data,but when i put local:true in the GridFilters,the entire grid gets disappeared
here is the code:
var myData = [
['Text Attribute','Text','Exact','Match','All Cases','1001'],
['Text Attribute','Text','Inexact','Confirmatory','Specific Cases','1002'],
['Long Text Attribute','Long Text','N/A','Solution','All Cases','1000'],
['Link Attribute','Link / Attachment','N/A','Solution','Specific Cases','1003','http://localhost:8080/consult/home-page.jsp'],
['List Attribute','List','OENUM','Confirmatory','All Cases','1004'],
['List Attribute','List','UENUM','Solution','Specific Cases','1005'],
['List Attribute','List','List of UENUM','Solution','All Cases','1006'],
['List Attribute','List','YES/NO','Solution','Specific Cases','1007'],
['Integer Attribute','Integer','Un-Bounded','Solution','All Cases','1008'],
['Integer Attribute','Integer','Lower Bounded','Match','Specific Cases','1009','12'],
['Integer Attribute','Integer','Upper Bounded','Confirmatory','All Cases','1010','67'],
['Integer Attribute','Integer','Fully Bounded','Match','Specific Cases','1011','12','67'],
['Integer Attribute','Integer','Between','Solution','All Cases','1012'],
['Real Attribute','Real','Un-Bounded','Solution','Specific Cases','1013','Un-Bounded'],
['Real Attribute','Real','Lower Bounded','Match','All Cases','1014','15'],
['Real Attribute','Real','Upper Bounded','Solution','Specific Cases','1015','69'],
['Real Attribute','Real','Fully Bounded','Solution','All Cases','1016','15','69'],
['Tree Attribute','Tree','Entire Tree','Match','All Cases','1017'],
['Tree Attribute','Tree','Folder','Solution','Specific Cases','1018'],
['Date Attribute','Date','After','Solution','All Cases','1019'],
['Date Attribute','Date','Before','Match','Specific Cases','1020'],
['Date Attribute','Date','On','Solution','All Cases','1021'],
['Date Attribute','Date','Around','Confirmatory','Specific Cases','1022']
];
simpleStore = new Ext.data.Store({
reader: new Ext.data.ArrayReader({}, [
{name: 'AttributeName'},
{name: 'DataType'},
{name: 'Range'},
{name: 'UseType',convert: function(v, rec) {
if (rec[3] == 'Match') return 0;
if (rec[3] == 'Confirmatory') return 1;
return 2;
}},
{name: 'ApplicableFor',convert: function(v, rec) {
if (rec[4] == 'All Cases') return 1;
return 0;
}},
{name: 'attId'},
{name: 'LowerBound'},
{name: 'UpperBound'}
])
});
simpleStore.loadData(myData);
-
You can't use a PagingToolbar with a Store with local data.
You would need a PagingStore for that (see User Extensions forum).