<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Hello ,</div><div><br></div><div>I am trying to make an application that allows to launch sql queries from the client and returns a feature collection as result. </div><div>This result have to be stored as well in a table as well in the map as features in a vector layer.</div><div><br></div><div>I have </div><div> - a datastore: sqlDatastore</div><div> - a panel: sqlResultPanel (GridPanel)</div><div> - a container: sqlPanel (container in which i store the panel)</div><div>I already implemented this. The problem is, when the client performs a different query in which data and structure differs from the previous query, I instantiate a new FeatureStore, a new Grid Panel and a new Layer.</div><div>Unfortunately I realize that the old Grid Panel is not correctly removed from the container in which i added this panel and consequentially I see in the container both grid panels.</div><div><br></div><div>I did:</div><div><br></div><div>// remove grid components from container</div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; ">sqlDatastore.removeAll(<span style="color: #6e79f0">true</span>);</div></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; ">sqlResultTablePanel.removeAll(<span style="color: #6e79f0">true</span>);</div></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; ">sqlPanel.remove(sqlResultTablePanel,<span style="color: #6e79f0">true</span>);</div></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; ">sqlResultTablePanel.destroy();</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; ">Is this the right sequence to destroy: datastore and grid panel?</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; ">Do you suggest me instead of instantiating a new Grid Panel to reuse the existing one and update only data store and column model?</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; ">thanks for your suggestion.</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; ">Markus</div></div></body></html>