easyui datagrid 在末尾增加操作列按鈕

 

 

 

$("#txx").datagrid({
nowrap:false,
idField:"id",
rows:mydata,
fit:true,
rownumbers:true,
singleSelect:true,
pagination:true,
pageList:[20,50,100],
onDblClickRow: queryInfo,
onClickRow: queryan,
remoteSort:false,
height:200,
columns:[[
{field:'SCZT',title:"狀態",align:"center",width:70},
{
field: 'ID', title: '操作', width: '35%', align: 'center', formatter: formatOper
}
  ]]

});




function formatOper(val, row, index) { return '<input type="button" onclick="remove(\'' + row["PID"] + '\')" value="校驗" />  <input type="button" onclick="removeXM(\'' + row["SCZT"] + '\')" value="刪除" />'; } function remove(pid) { alert(pid); } function removeXM(pid) { alert(pid); }

  

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章