我有一个功能:ExtJS的:传递变量FormPanel中
function saveToJ(feature) {
var str = new OpenLayers.Format.GeoJSON(out_options).write(feature, true);
str = str.replace(/,/g, ', ');
strObj = Ext.decode(str);
if(strObj.properties.name == null) {
...
} else {
if(!win) {
win = new Ext.Window({
title : "Edit",
items : [editPanel],
closeAction : 'hide'
});
}
win.show();
}
}
}
和面板:
var editPanel = new Ext.form.FormPanel({
width : 400,
defaults : {
width : 230
},
defaultType : 'textfield',
items : [{
fieldLabel : 'Name',
name : 'name',
allowBlank : false,
}],
buttons : [editSaveBtn, editDeleteBtn]
});
我想做的事就是上使用strObj.properties.name
作为value
为外地我的小组。 但value: strObj.properties.name
给出了一个错误,strObj
未定义。
strObj
声明在saveToJ
函数之外。
我在做什么错了?
谢谢,帮我理解。 'editPanel'渲染时'strObj'真的是空的,所以我必须通过它。 – k102 2012-03-05 07:48:03