nd-users
v1.0.1
Published
搜索选人删人组件
Downloads
8
Readme
nd-users
搜索选人删人组件
安装
$ npm install nd-users --save
使用
var UsersModel = require('model/uc/users')
var user = require('misc/user')
var Users = require('nd-users')
function makeGranters(uids) {
return new Users($.extend(true, {
uids: uids,
source: user.getUsers,
proxy: new UsersModel()
}, plugin.getOptions('view'))).before('render', function() {
this.confirm.on('confirm', function() {
plugin.trigger('submit')
}).on('cancel', function() {
plugin.trigger('hide', this)
})
})
}
// use nd-users
在表单里面使用
function makeGranters(uids) {
return new FormExtra($.extend(true, {
fields: [
{
name: 'uids',
attrs: {
'x-type': 'users',
required: 'required',
uids: JSON.stringify(uids)
}
}
],
pluginCfg: {
'Users': [function(){
this.setOptions('config',{
proxy: new UsersModel(),
source: user.getUsers
})
}]
}
}, plugin.getOptions('view')))
}
- 样式可以引入src中的users.css的默认样式