[Users] Synchronising LayerTree Node w/ checkbox and Map with aGrid Panel

Matt Priour mpriour at kestrelcomputer.com
Thu Feb 17 15:29:41 CET 2011


The issue is that you are looking at 2 totally different things.
The checkbox for the layer on the tree controls the WFS layer's visibility on the map.
This merely makes the div which hosts the vector features visible or not once the features have initially loaded.

The grid is attached to a FeatureStore synced with the WFS Layer's features.
When you clear the grid then you are affecting the store and if you have the sync direction from layer-to-store only then removing records from the store doesn't remove them from the layer.

If you really want the features to clear from the grid and then return in response to the checkbox, then what you should do is apply an always false filter to the feature store when you uncheck the layer and remove the filter when you check the layer. (I would actually attach that to the layer's visibilitychanged event and not the checkbox's events)

Matt Priour
Kestrel Computer Consulting


From: Daniel Behr 
Sent: Thursday, February 17, 2011 4:24 AM
To: users at geoext.org 
Subject: [Users] Synchronising LayerTree Node w/ checkbox and Map with aGrid Panel


Hi,
rather simple question, I guess, but I cant figure it out.

I have a mapPanel and a treePanel, added a WFS Layer with a checkbox to 
the tree and when the box is checked the features are loaded and I see a 
list of features in a grid panel below.
this works as expected until the box is unchecked. The grid panel is not 
cleared.

adding a listener to the tree config clears the gridpanel but after 
checking the box again the map is updated but the grid stays empty.

listeners: {
    'checkchange': function(node, checked) {
if (checked === false) {
      // gridPanel.toggleCollapse()
    gridPanel.removeAll();
    gridPanel.update()
}
    }
}

does anyone know of an example where I can look at the code or maybe 
someone can give me a hint what I am missing here?
thanks
Dan
_______________________________________________
Users mailing list
Users at geoext.org
http://www.geoext.org/cgi-bin/mailman/listinfo/users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.geoext.org/pipermail/users/attachments/20110217/3273024d/attachment.htm 


More information about the Users mailing list