1、placeholder 属性提供可描述输入字段预期值的提示信息(hint)
<input type="search" name="username" placeholder="Search W3School"
/>
var rows = [
{ "name": "姓名", "group": "帐号", "value": "", "editor": "text" },
{ "name": "帐号", "group": "帐号", "value": "", "field": "id", "editor": "text" },
{ "name": "职位", "value": "", "group": "其它", "field": "Role", "editor": { "type": 'combobox', "options": { "valueField": 'value', "textField": 'name', "url": '../../home/GetSelectItems_Role', "required": true}} },
{ "name": "办公电话", "value": "", "group": "其它", "field": "officePhone", "editor": "text" },
{ "name": "移动电话", "group": "其它", "value": "", "field": "mobilePhone", "editor": { "type": 'validatebox', "options": { "required": true}} },
{ "name": "集团短号", "group": "其它", "editor": "text", "value": "", "field": "mobilePhoneShort" },
{ "name": "第二联系方式", "group": "其它", "value": "", "field": "phoneSecond", "editor": { "type": 'validatebox', "options": { "required": true}} },
{ "name": "备注", "group": "其它", "editor": "text", "value": "", "field": "remark" }
];
$('#edit').propertygrid({
height: 'auto',
showGroup: true,
scrollbarSize: 0,
columns: [[
{ field: 'name', title: 'Name', width: 100, resizable: true },
{ field: 'value', title: 'Value', width: 100, resizable: false }
]]
});
$('#edit').propertygrid('loadData', rows);
window.οnlοad=function(){
$('#f').propertygrid({
showHeader:false,
columns : [ [ {
field : 'name',
width : 200,
sortable : true
}, {
field : 'value',
width : 800,
sortable : true
} ] ]
});
}
附:
页面自动执行(加载)js的几种方法
5、showHeader:false不显示标题
showGroup:true是否显示属性组
propertygrid从datagrid继承,行数据格式和datagrid相同,作为一个property row,以下字段是必须的:
name:字段名称
value: 可编辑的字段值
group:分组字段值
editor: 编辑器