admin模块目前下有四个子模块:members,group,wallpapers,themes
这节讲members子模块
使用了rowEditor插件,会自动找出设置了editor的列,修改完成会自动复原
desktop框架会根据user的语言选择加载本地化文件,用户所在组决定了用户的权限.
/*
admin子模块
*/
QoDesk.QoAdmin.Members = Ext.extend(Ext.grid.GridPanel, {
ownerModule: null,
constructor: function(config) {
config = config || {};
this.ownerModule = config.ownerModule;
this.folder = config.folder;
this.locale = config.locale || {};
//var isZh = function(){return this.locale.language.toLowerCase().indexOf('zh') > -1;};
var searchField = new Ext.form.TextField({
width:150,
emptyText:this.locale.keyword,
enableKeyEvents: true,
style: {
paddingBottom:'4px',
marginLeft:'10px',
marginRight:'5px'
},
checkKeyCode:function(keyCode){
return ((keyCode>=48 && keyCode<=57)||(keyCode>=65 && keyCode<=90)||(keyCode>=97 && keyCode<=121) || keyCode==8 || keyCode==46 || keyCode==17 || keyCode==0)
},
listeners:{
keyup: {
fn:function(textField,e){
if(textField.checkKeyCode(e.browserEvent.which)){
this.getStore().clearFilter();
if(textField.getValue().length > 1){
this.getStore().filterBy(function(record,id){
var val = textField.getValue().trim().toLowerCase(),
inEmail = record.data.email.toLowerCase().indexOf(val) > -1,
inName = typeof record.data.name == 'string' ? record.data.name.toLowerCase().indexOf(val) > -1 : false,
inFi