fixed problem with custom scroll and getting value model in edit feature window

2.0
xavijam 12 years ago
parent 4afa7775a5
commit 441fce44ec

@ -23,31 +23,18 @@
'string': 'String'
},
render: function() {
cdb.ui.common.Dialog.prototype.render.call(this);
this.activeWizardOption(this.option);
// Custom scroll code (showing gradients at the end and beginning of the content)
this.scroll = new cdb.admin.CustomScrolls({
parent: this.$('div.content'),
el: this.$('div.content > div.wrapper')
});
this.addView(this.scroll);
return this;
},
/**
* Render content
*/
render_content: function() {
var $content = $('<div>').addClass('wrapper')
var $content = $('<div>').addClass('edit_content')
, $wrapper = $('<div>').addClass('wrapper')
, self = this
, schema = this.options.table.get('schema')
, hiddenColumns = this.options.table.hiddenColumns;
_.each(this.model.attributes,function(val,attr){
if (!_.contains(hiddenColumns,attr)) {
// Get column type
@ -67,13 +54,23 @@
}, self)
// Add to content
$content.append(subView.render().el);
$wrapper.append(subView.render().el);
// Add subview to this view (cleaning purposes)
self.addView(subView);
}
});
// Custom scroll code (showing gradients at the end and beginning of the content)
var scroll = new cdb.admin.CustomScrolls({
parent: $content,
el: $wrapper
});
this.addView(scroll);
$content.append($wrapper);
return $content;
},
@ -81,7 +78,8 @@
// Get values from the subviews
var new_model = {};
_(this._subviews).each(function(v) {
new_model[v.model.get("attribute")] = v.model.get("value");
if (v.model && v.model.get('value'))
new_model[v.model.get("attribute")] = v.model.get("value");
});
// Set row model

Loading…
Cancel
Save