[Users] update/replace protocol in geoext.form.formpanel
Gery .
gamejihou at hotmail.com
Tue Jan 15 00:25:35 CET 2013
Dear users,
Since extjs, geoext, openlayers are javascript libraries, I've tried things such as "eval" to make variables accessible in the code below but
no luck so far. I want to update or replace a variable (ie. in the protocol) that is at first
null (so null in protocol and also outside formPanel), then defined with something (ie. inside the handler function, is it right to define it there?) and then
use it inside a variable (as proto in "protocol: proto", so replace the one is already null), here is an example:
var proto = null; # <--- replace here (old "proto")
var formPanel = new GeoExt.form.FormPanel({
protocol: proto, # <--- or replace here (old "proto")
items: [{
xtype: "combo",
id: "idcombo",
etc...
}, {
xtype: "textfield",
id: "idtext",
etc...
}],
button:[{
text: "search",
handler: function() {
formPanel.search();
var combo = Ext.getCmp('idcombo').getValue();
var text = Ext.getCmp('idtext').getRawValue();
var proto: new OpenLayers.Protocol.HTTP({ # <------- new "proto" to replace above
url: "http://www.pub.pub/" + combo + "/rhen/" + text
}),
}
}]
});is is possible to use this new "proto" to replace the old "proto"? if so, how can I do it?, not sure if new "proto" has to go in
the handler: function. I defined "var proto = null" at first because without it the formPanel doesn't render due to "proto is not defined". I'll appreciate your support, thanks in advance.
Best regards,
Gery
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.geoext.org/pipermail/users/attachments/20130114/23fac4b2/attachment.htm
More information about the Users
mailing list