zefyrus
23 Aug 2007, 11:42 AM
Hi all
I have this code:
[CODE]Ext.QuickTips.init();
function formatBoolean(value){
return value ? 'Sim' : 'Não';
};
// shorthand alias
var fm = Ext.form, Ed = Ext.grid.GridEditor;
var Medias = Ext.data.Record.create([
{name: 'id_midia', type: 'int'},
{name: 'nome', type: 'string'},
{name: 'link', type: 'string'},
{name: 'id_cidade', type: 'int'}
]);
ds = new Ext.data.Store({
proxy: new Ext.data.HttpProxy({
url: 'mediaListJson.php'
}),
// create reader that reads the Topic records
reader: new Ext.data.JsonReader({
// records will have an "Item" tag
root: 'dados',
id: 'id_media',
totalProperty: 'total'
}, Medias),
remoteSort: false
});
var Cities = Ext.data.Record.create([
{name: 'id_cidade', type: 'int'},
{name: 'id_estado', type: 'int'},
{name: 'cidade', type: 'string'},
{name: 'estado', type: 'string'}
]);
dsMN = new Ext.data.Store({
proxy: new Ext.data.HttpProxy({url: 'citiesJson.php'}),
reader: new Ext.data.JsonReader({
root: 'dados',
id: 'id_cidade',
cidade: 'cidade',
estado: 'estado'
}, Cities)
});
function formatCities(value){
var pValue = dsMN.getById(parseInt(value));
if (pValue){
alert(pValue);
alert(pvalue.get('cidade'));
alert(pValue.dados.cidade);
alert(pValue.cidade);
return pValue.data.cidade;
}else{
return 'Cidade n
I have this code:
[CODE]Ext.QuickTips.init();
function formatBoolean(value){
return value ? 'Sim' : 'Não';
};
// shorthand alias
var fm = Ext.form, Ed = Ext.grid.GridEditor;
var Medias = Ext.data.Record.create([
{name: 'id_midia', type: 'int'},
{name: 'nome', type: 'string'},
{name: 'link', type: 'string'},
{name: 'id_cidade', type: 'int'}
]);
ds = new Ext.data.Store({
proxy: new Ext.data.HttpProxy({
url: 'mediaListJson.php'
}),
// create reader that reads the Topic records
reader: new Ext.data.JsonReader({
// records will have an "Item" tag
root: 'dados',
id: 'id_media',
totalProperty: 'total'
}, Medias),
remoteSort: false
});
var Cities = Ext.data.Record.create([
{name: 'id_cidade', type: 'int'},
{name: 'id_estado', type: 'int'},
{name: 'cidade', type: 'string'},
{name: 'estado', type: 'string'}
]);
dsMN = new Ext.data.Store({
proxy: new Ext.data.HttpProxy({url: 'citiesJson.php'}),
reader: new Ext.data.JsonReader({
root: 'dados',
id: 'id_cidade',
cidade: 'cidade',
estado: 'estado'
}, Cities)
});
function formatCities(value){
var pValue = dsMN.getById(parseInt(value));
if (pValue){
alert(pValue);
alert(pvalue.get('cidade'));
alert(pValue.dados.cidade);
alert(pValue.cidade);
return pValue.data.cidade;
}else{
return 'Cidade n