mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-09-22 12:09:19 +08:00
修复用户分配角色的BUG
This commit is contained in:
44
OpenAuth.Mvc/BllScripts/grid.js
Normal file
44
OpenAuth.Mvc/BllScripts/grid.js
Normal file
@@ -0,0 +1,44 @@
|
||||
// ***********************************************************************
|
||||
// Assembly : OpenAuth.Mvc
|
||||
// Author : yubaolee
|
||||
// Created : 04-12-2016
|
||||
//
|
||||
// Last Modified By : yubaolee
|
||||
// Last Modified On : 04-12-2016
|
||||
// ***********************************************************************
|
||||
// <copyright file="grid.js" company="www.cnblogs.com/yubaolee">
|
||||
// 版权所有(C) 2015
|
||||
// </copyright>
|
||||
// <summary>grid基类</summary>
|
||||
// ***********************************************************************
|
||||
|
||||
function Grid() {
|
||||
this.maingrid = undefined;
|
||||
this.selectObjs = function () {
|
||||
var selectedDatas = this.maingrid.data('selectedDatas');
|
||||
if (selectedDatas == undefined || selectedDatas.length == 0) {
|
||||
$(this).alertmsg('warn', '至少选择一个对象');
|
||||
return null;
|
||||
}
|
||||
return selectedDatas;
|
||||
};
|
||||
}
|
||||
|
||||
//选择单行对象
|
||||
Grid.prototype.getSelectedObj = function () {
|
||||
var selectedDatas = this.selectObjs();
|
||||
return selectedDatas == null ? null : selectedDatas[0];
|
||||
};
|
||||
//选择多行对象
|
||||
Grid.prototype.getSelectedMany = function () {
|
||||
return this.selectObjs();
|
||||
};
|
||||
//返回选择多行的属性JSON,默认选择id属性,如果选择其他属性,可重写
|
||||
Grid.prototype.getSelectedProperties = function (propName) {
|
||||
var selected = this.selectObjs();
|
||||
if (selected == null) return null;
|
||||
|
||||
var ids = selected.map(function (elem) { return elem[propName]; }).join(",");
|
||||
ids = '[' + ids + ']'; //拼成一个JSON
|
||||
return ids;
|
||||
};
|
Reference in New Issue
Block a user