ListResourceView.js revision 3b00836ee5cd2bc9bc0d5e36506efe8d8e88c1ab
/**
* The contents of this file are subject to the terms of the Common Development and
* Distribution License (the License). You may not use this file except in compliance with the
* License.
*
* You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
* specific language governing permission and limitations under the License.
*
* When distributing Covered Software, include this CDDL Header Notice in each file and include
* the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
* Header, with the fields enclosed by brackets [] replaced by your own identifying
* information: "Portions copyright [year] [name of copyright owner]".
*
* Copyright 2011-2015 ForgeRock AS.
*/
/*global define */
"jquery",
"underscore",
"handlebars",
"backgrid",
"backgrid-paginator",
"backgrid-selectall"
], function($,
_,
model: {},
events: {
"click #reloadGridBtn": "reloadGrid",
"click #clearFiltersBtn": "clearFilters",
"click #deleteSelected": "deleteSelected"
},
},
reloadGrid: function(event){
if(event) {
}
},
clearFilters: function(event){
if (event) {
}
},
getURL: function(){
},
getCols: function(){
selectCol = {
name: "",
cell: "select-row",
headerCell: "select-all",
sortable: false,
editable: false
};
var cols = [],
unorderedCols = [];
if(schema !== "invalidObject"){
this.data.validObject = true;
if(schema){
}
} else {
//if _id is in the schema properties and is searchable add it
if(colName === "_id") {
{
"name":"_id",
"key": true,
"cell": "string",
"sortable": true,
"editable": false,
"sortType": "toggle"
}
);
} else {
if(parentProp) {
}
{
"name": colName,
"sortable": true,
"editable": false,
"sortType": "toggle"
}
);
}
}
}
}, this));
}, this);
if(col){
}
});
});
} else {
}
} else {
if(col !== "_id"){
{
"name": col,
"label": col,
"cell": "string",
"sortable": true,
"editable": false,
"sortType": "toggle"
}
);
}
});
}
});
}
} else {
this.data.validObject = false;
}
},this));
return prom;
},
objectNameClean: function() {
},
toggleDeleteSelected: function() {
} else {
}
},
deleteSelected: function(e) {
e.preventDefault();
uiUtils.confirmDialog($.t("templates.admin.ResourceEdit.confirmDeleteSelected"), "danger", _.bind(function(){
var promArr = [];
}, this));
this.reloadGrid();
messagesManager.messages.addMessage({"message": $.t("templates.admin.ResourceEdit.deleteSelectedSuccess")});
},this));
}, this));
},
this.data.isSystemResource = false;
this.data.selectedItems = [];
this.data.isSystemResource = true;
}
this.parentRender(function() {
this.buildResourceListGrid(cols);
if(callback) {
callback();
}
});
},this));
},
buildResourceListGrid: function (cols) {
var _this = this,
grid_id = this.grid_id_selector,
if (this.data.isSystemResource) {
}
});
if (!defaultSystemResourceSortKey) {
}
}
if (defaultSystemResourceSortKey) {
} else {
}
} else {
state = null;
}
}, this.data.isSystemResource)
});
className: "backgrid table table-hover",
emptyText: $.t("templates.admin.ResourceList.noData"),
callback: function(e) {
return;
}
routeName = (!_this.data.isSystemResource) ? "adminEditManagedObjectView" : "adminEditSystemObjectView";
}
}
})
});
windowSize: 0
});
this.bindDefaultHandlers();
},
if (selected) {
}
} else {
}
this.toggleDeleteSelected();
},
bindDefaultHandlers: function () {
var _this = this;
}, this));
var hasFilters = false;
hasFilters = true;
}
});
if (hasFilters) {
} else {
}
});
}
});
return new ListResourceView();
});