WebInspector: View throughs the exception when a child view are removed by removeChil...
[WebKit-https.git] / Source / WebCore / inspector / front-end / DatabaseTableView.js
index 18a5cac6423cdb3ee0b01472c322113dcba97afa..c7b87a20d235cefac7baa20b0c4045e80acc1604 100644 (file)
@@ -42,9 +42,8 @@ WebInspector.DatabaseTableView = function(database, tableName)
 }
 
 WebInspector.DatabaseTableView.prototype = {
-    show: function(parentElement)
+    wasShown: function()
     {
-        WebInspector.View.prototype.show.call(this, parentElement);
         this.update();
     },
 
@@ -60,6 +59,7 @@ WebInspector.DatabaseTableView.prototype = {
 
     _queryFinished: function(columnNames, values)
     {
+        this.detachChildViews();
         this.element.removeChildren();
 
         var dataGrid = WebInspector.DataGrid.createSortableDataGrid(columnNames, values);
@@ -68,13 +68,13 @@ WebInspector.DatabaseTableView.prototype = {
             this._emptyView.show(this.element);
             return;
         }
-
-        this.element.appendChild(dataGrid.element);
+        dataGrid.show(this.element);
         dataGrid.autoSizeColumns(5);
     },
 
     _queryError: function(error)
     {
+        this.detachChildViews();
         this.element.removeChildren();
 
         var errorMsgElement = document.createElement("div");