<table id= "transferredviewtable" class= "Easyui-datagrid" >
<thead>
<tr>
<th data-options= "field: ' Trastaid ', hidden:true" > Staff id</th>
<th data-options= "field: ' Trastaname '" > Name </th>
<th data-options= "field: ' Traorgid ', hidden:true" > Organization id</th> <th data-options=
"Field: ' Traorgname ', width:250" > Company Department </th>
<th data-options= "field: ' Operation ', width:100" > action </th>
</tr>
</thead>
</table>
This is the JSP page.
$ ("#transferredViewTable"). DataGrid ({
url:url, //Here is a URL, the background transmits data
collapsible:true,
Singleselect:false,
columns:[[{field: ' Trastaid ', hidden:true},
{field: ' Trastaname ', title: ' Name '},
{ Field: ' Traorgid ', hidden:true},
{field: ' Traorgname ', title: ' Company department ', width:250},
{field: ' Operation ', title: ' Operation ', width:100,
formatter:function (value,rec,index) {
var del = ' <a href= ' # ' class= ' Easyui-linkbutton ' data-options= "Plain:true,iconcls:\ ' icon-remove\ '" onclick= "Deltransferredstaff (' +value+ ')" > Delete </a> ";
Return del;}
]
});
function Deltransferredstaff (value) { //Here is the delete operation, in fact I this deletion is not deleted in the background. The reload with the DataGrid has no effect on
var index = $ ("#transferredViewTable"). DataGrid ("Getrowindex", value); At the beginning, the Deltransferredstaff parameter is index, but if
$ ("#transferredViewTable"). DataGrid ("DeleteRow", index); The row number error occurs when there is data below the deleted row
}
If there is an error, you can bring it up. Thank you.