RoleUsersView.js revision e26e5073e1266868172d72453c97f413fe2fb603
/**
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2011-2015 ForgeRock AS. All rights reserved.
*
* 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
* See the License for the specific language governing
* permission and limitations under the License.
*
* When distributing Covered Code, include this CDDL
* Header Notice in each file and include the License file
* If applicable, add the following below the CDDL Header,
* with the fields enclosed by brackets [] replaced by
* your own identifying information:
* "Portions Copyrighted [year] [name of copyright owner]"
*/
/*global define, sessionStorage */
"jquery",
"underscore",
"handlebars",
"jqgrid"
], function($, _, Handlebars, AbstractView, eventManager, constants, cookieHelper, JQGridUtil, resourceDelegate, messagesManager) {
element: "#role-users",
noBaseTemplate: true,
events: {
"click .actionBtn": "performAction"
},
reloadGrid: function(event){
},
getURL: function(){
},
getCols: function(){
var cols = [],
unorderedCols = [];
"name": "hasRole",
"label": "Has Role",
"width": 100,
"search": false,
"sortable": false,
"align": "center"
});
if(schema){
{
"name": colName,
}
);
}
}, this));
if(col){
}
});
} else {
}
} else {
if(col !== "_id"){
{
"name": col,
}
);
}
});
}
});
}
},this));
return prom;
},
getTotal: function(){
//$.get(this.getURL() + '?_queryId=get-users-of-direct-role&role=' + this.data.roleId).then(
function(qry){
},
function(){
}
);
return prom;
},
selectedRows: function() {
},
toggleActions: function() {
} else {
}
},
performAction: function(e) {
promArr = [],
e.preventDefault();
doUpdate = false;
if(action === "remove") {
successMsg = $.t("templates.admin.RoleUsersTemplate.removeSelectedSuccess",{ roleId: this.data.role.properties.name });
} else {
successMsg = $.t("templates.admin.RoleUsersTemplate.addSelectedSuccess",{ roleId: this.data.role.properties.name });
}
if(doUpdate) {
}
},this));
},this));
},this));
},
var _this = this;
if(total.resultCount){
this.parentRender(function() {
var _this = this,
grid_id = this.grid_id_selector,
width: 920,
shrinkToFit: true,
sortorder: 'asc',
multiselect: true,
jsonReader : {
repeatitems: false,
id: "_id",
},
beforeRequest: function(){
},
if(btn === "records"){
}
},
}
},
}, this),
onSelectRow: _.bind(function() {
this.toggleActions();
}, this),
onSelectAll: _.bind(function() {
this.toggleActions();
}, this)
},
{
search: true,
searchOperator: "sw",
suppressColumnChooser: true,
return '_id sw ""';
},
});
if(callback) {
callback();
}
});
} else {
this.parentRender(callback);
}
},this));
}
});
return new RoleUsersView();
});