PDA

View Full Version : gridfilter



nelstu
3 May 2012, 3:26 PM
i use grid-filter with remote

when i select filter list return id

i want return name

what can i do

thank

Nelson Stuardo



Ext.onReady(function(){


Ext.QuickTips.init();

// for this demo configure local and remote urls for demo purposes
var url = {
local: 'grid-filter.json', // static data file
remote: 'grid-filter.php'
};


// configure whether filter query is encoded or not (initially)
var encode = false;

// configure whether filtering is performed locally or remotely (initially)
var local = false;


store = new Ext.data.JsonStore({
// store configs
autoDestroy: true,
url: (local ? url.local : url.remote),
remoteSort: false,
sortInfo: {
field: 'id',
direction: 'ASC'
},
storeId: 'myStore',

// reader configs
idProperty: 'id',
root: 'data',
totalProperty: 'total',
fields: [{
name: 'id'
}, {
name: 'CLIENTE'
}, {
name: 'TRABAJO'
}, {
name: 'VENDEDOR'
}, {
name: 'visible',
type: 'boolean'
}, {
name: 'size'
}]
});


var store_CLIENTE = new Ext.data.JsonStore({
totalProperty: 'total1',
root: 'results',
url: 'dataextcalidad_CLIENTE.php',
fields: ['CLIENTE']
});
var store_VENDEDOR = new Ext.data.JsonStore({
totalProperty: 'total1',
root: 'results',
url: 'dataextcalidad_VENDEDOR.php',
fields: [{
name: 'id'
}, {
name: 'nombre'
}]
});
var filters = new Ext.ux.grid.GridFilters({
// encode and local configuration options defined previously for easier reuse
encode: encode, // json encode the filter query
local: local, // defaults to false (remote filtering)
filters: [{
type: 'numeric',
dataIndex: 'id'
}, {
type: 'string',
dataIndex: 'CLIENTE',
itemField: 'CLIENTE',
labelField: 'CLIENTE',
store: store_CLIENTE,
}, {
type: 'string',
dataIndex: 'TRABAJO'
}, {
type: 'list',
dataIndex: 'VENDEDOR',
itemField: 'VENDEDOR',
labelField: 'nombre',
store: store_VENDEDOR
}, {

scottmartin
7 May 2012, 3:44 PM
Are you talking about the response from the server?

Scott.

nelstu
8 May 2012, 5:10 AM
yes

when i use in localmode, work perfect

but when i use in remote mode don t show records

if i define option manually with this for example

options: ['small', 'medium', 'large', 'extra large'],

show me the query in remote mode but i have more options in the store


thanks

Nelson Stuardo