diff --git a/web/app/views/index.scala.html b/web/app/views/index.scala.html
index 47dd7d8444..e72a99575d 100644
--- a/web/app/views/index.scala.html
+++ b/web/app/views/index.scala.html
@@ -321,7 +321,7 @@
diff --git a/web/public/javascripts/components/components.js b/web/public/javascripts/components/components.js
index b940e240f3..73d2c2d230 100644
--- a/web/public/javascripts/components/components.js
+++ b/web/public/javascripts/components/components.js
@@ -102,6 +102,36 @@ App.DatasetSchemaComponent = Ember.Component.extend({
}, 500);
},
actions: {
+ getSchema: function(){
+ var _this = this
+ var id = _this.get('dataset.id')
+ var columnUrl = 'api/v1/datasets/' + id + "/columns";
+ _this.set("isTable", true);
+ _this.set("isJSON", false);
+ $.get(columnUrl, function(data) {
+ if (data && data.status == "ok")
+ {
+ if (data.columns && (data.columns.length > 0))
+ {
+ _this.set("hasSchemas", true);
+ data.columns = data.columns.map(function(item, idx){
+ item.commentHtml = marked(item.comment).htmlSafe()
+ return item
+ })
+ _this.set("schemas", data.columns);
+ setTimeout(initializeColumnTreeGrid, 500);
+ }
+ else
+ {
+ _this.set("hasSchemas", false);
+ }
+ }
+ else
+ {
+ _this.set("hasSchemas", false);
+ }
+ });
+ },
setView: function (view) {
switch (view) {
case "tabular":
diff --git a/web/public/javascripts/components/schema-comment.js b/web/public/javascripts/components/schema-comment.js
index 9835ee59b9..5c5b0c0a35 100644
--- a/web/public/javascripts/components/schema-comment.js
+++ b/web/public/javascripts/components/schema-comment.js
@@ -497,7 +497,10 @@ App.SchemaCommentComponent = Ember.Component.extend({
})
.on('hidden.bs.modal', function(){
_this.set('propModal', false)
- _this.sendAction('getSchema')
+ if (_this.parentView && _this.parentView.controller)
+ {
+ _this.parentView.controller.send('getSchema')
+ }
$("#datasetSchemaColumnCommentModal").modal('hide');
})
}, 300)
diff --git a/web/public/javascripts/main.js b/web/public/javascripts/main.js
index 3c89ba6fb0..7696084a35 100644
--- a/web/public/javascripts/main.js
+++ b/web/public/javascripts/main.js
@@ -339,3 +339,8 @@ function filterListView(category, filter)
}
}
+function initializeColumnTreeGrid()
+{
+ $('#json-table').treegrid();
+}
+
diff --git a/web/public/javascripts/routers/datasets.js b/web/public/javascripts/routers/datasets.js
index 4bb70f33c6..5ca2a9c633 100644
--- a/web/public/javascripts/routers/datasets.js
+++ b/web/public/javascripts/routers/datasets.js
@@ -1,7 +1,3 @@
-function initializeColumnTreeGrid()
-{
- $('#json-table').treegrid();
-}
function initializeDependsTreeGrid()
{