[Users] Geoext search?
Bart van den Eijnden
bartvde at osgis.nl
Sun Feb 14 16:56:12 CET 2010
Hi Zoran,
ok, I see now, indeed you need to use Ext.form.FormPanel, ignore my previous post about that.
The other problem you reported (ct is undefined), is because you are running your javascript code before the DOM is ready, and your div is simply not yet there. So use Ext.onReady instead to wrap your code, something like:
Ext.onReady(
function() {
var formPanel = new Ext.form.FormPanel({
renderTo: "formpanel",
items: [{
xtype: "textfield",
name: "name__like",
value: "mont"
}, {
xtype: "textfield",
name: "elevation__ge",
value: "2000"
}]
});
var searchAction = new GeoExt.form.SearchAction(formPanel.getForm(), {
protocol: new OpenLayers.Protocol.WFS({
url: "http://publicus.opengeo.org/geoserver/wfs",
featureType: "tasmania_roads",
featureNS: "http://www.openplans.org/topp"
}),
abortPrevious: true
});
formPanel.getForm().doAction(searchAction, {
callback: function(response) {
// response.features includes the features read
// from the server through the protocol
}
});
});
Best regards,
Bart
On Feb 14, 2010, at 4:45 PM, Zoran Jankovic wrote:
>
> On Sun, Feb 14, 2010 at 4:37 PM, Bart van den Eijnden <bartvde at osgis.nl> wrote:
> Right do not use that cdn file (http://extjs.cachefly.net/builds/ext-cdn-771.js), it does not contain all Ext files, it is not a full build of Ext, it misses Form. Try instead something like (change version for your Ext version):
>
> <script type="text/javascript" src="http://extjs.cachefly.net/ext-2.3.0/adapter/ext/ext-base.js"></script>
> <script type="text/javascript" src="http://extjs.cachefly.net/ext-2.3.0/ext-all.js"></script>
>
> Best regards,
> Bart
>
> .....
>
> I've tried that, and before I tried with my local copy of Ext-2.3.0 and Ext -3.1.1, same error message: Ext.form.panel is not a constructor. :-(
>
> Could I be missing something else here? Maybe it's a version thing, maybe it'll work with an older version of Geoext?
>
> BR,
>
>
> ---
> Zoran Jankovic
> ZIS-Izrada softvera i savjetovanje / ZIS - Software Development and Consulting
>
> http://www.zisis.hr
>
> M: 00 385 98 682 902
> T: 00 385 44 683 374
>
> A. Senoe 4
> 44320 Kutina
> Croatia
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.geoext.org/pipermail/users/attachments/20100214/757a909f/attachment.htm
More information about the Users
mailing list