Resolved few issues in the collection controls. UniqueCollectionControl

was not honouring the change events after execution of the function -
'render' more than one time. Change the label of the Add button to make
it consistent with the Unique Collection Control.
This commit is contained in:
Khushboo Vashi 2016-04-01 15:25:53 +05:30 committed by Ashesh Vashi
parent 1a5eb0c417
commit 35a1390251

View File

@ -899,7 +899,7 @@
}, },
render: function() { render: function() {
// Clean up existing elements // Clean up existing elements
this.cleanup(); this.undelegateEvents();
var field = _.defaults(this.field.toJSON(), this.defaults), var field = _.defaults(this.field.toJSON(), this.defaults),
attributes = this.model.toJSON(), attributes = this.model.toJSON(),
@ -945,6 +945,7 @@
this.$el.html(grid).addClass(field.name); this.$el.html(grid).addClass(field.name);
this.updateInvalid(); this.updateInvalid();
this.delegateEvents();
return this; return this;
}, },
showGridControl: function(data) { showGridControl: function(data) {
@ -1169,7 +1170,7 @@
showGridControl: function(data) { showGridControl: function(data) {
var gridHeader = ["<div class='subnode-header'>", var gridHeader = ["<div class='subnode-header'>",
" <label class='control-label col-sm-4'>" + data.label + "</label>" , " <label class='control-label col-sm-4'>" + data.label + "</label>" ,
" <button class='btn-sm btn-default add'>Add</buttton>", " <button class='btn-sm btn-default add'>ADD</buttton>",
"</div>"].join("\n"); "</div>"].join("\n");
gridBody = $("<div class='pgadmin-control-group backgrid form-group col-xs-12 object subnode'></div>").append(gridHeader); gridBody = $("<div class='pgadmin-control-group backgrid form-group col-xs-12 object subnode'></div>").append(gridHeader);