用FancyForm添加用户角色,求解释这段代码,

var form = $('#form').FancyForm({
title: '添加角色',
width: 345,
height: 325,
inputWidth: 190,
labelWidth: 60,

url: '<%=path %>/sysRoleController/addRole.do',
params: {
param1: 1,
param2:'string'
},
defaults: {
type: 'string'
},
items: [{
label: '设置编号',
emptyText: '请输入编号',
name: 'roleNo',
valid: {
blank: false,
blankText: '编号不能为空!',
text: '编号不能为空! ',
}
},{
label: '设置角色名',
emptyText: '请输入角色名',
name: 'roleName',
valid: {
blank: false,
blankText: '角色名不能为空!',
text: '角色名不能为空! ',
}
},{
type: 'textarea',
label: '角色描述',
name: 'roleDesc',
height:60
},{
type: 'checkbox',
label: '是否启用',
name: 'flag'
}],
buttons: [{
text: '返回',
handler: function(){
history.go(-1);
}
},{
text: '清除',
handler: function(){
console.log('clear');
form.clear();
}
},{
text: '提交',
handler: function(){
console.log('提交');
form.submit({
params: {
param3: 'Some Values'
},
success: function(result, status, xhr){
console.log('success');
console.log(arguments);
},
error: function(xhr,status,error){
console.log('error');
console.log(arguments);
}
});
}
}],
events: [{
key: function(form, index, value){
}
}]
});
prettyPrint();
};