datagrid 对当前行进行修改和保存

columns:[[
               {field:'id',title:'id',width:40,align:'center',hidden:true},
      {field:'name',title:'名称',width:40,align:'center',sortable: true,
                 editor: { type: 'validatebox', options: { required: true} }
      },
    {field:'person',title:'使用者',width:40,align:'center',sortable: true,
      editor: { type: 'validatebox', options: { required: true} }
    },
    {field:'count',title:'数量',width:40,align:'center'},
    {field:'dept_name',title:'部门',width:40,align:'center',sortable: true,
    editor: { type: 'validatebox', options: { required: true} }
    },    
    {field:'uniques',title:'唯一标示',width:40,align:'center'},

       {field:'operation',title:'操作',width:70,align:'center',

//===============================点击修改时
function updateEvent(id,index){

$("#companyTable").datagrid("beginEdit", index);



}

//=========进行保
function saveEnent(id,index){





$("#companyTable").datagrid("endEdit", index);

你可能感兴趣的:(datagrid 对当前行进行修改和保存)