我們可以先在colmodel中添加數據
{name:'providerId',search:false,index:'providerId', width:30,sortable: false, formatter: editLink}
然後可以在formatter後面加入我們的構造函數
-
function editLink(cellValue, options, rowdata, action)
-
{
-
return "<a href='<%=request.getContextPath()%>/Admin/editProvider/" + rowdata.providerId + "' οnclick='getContent' class='ui-icon ui-icon-pencil' ></a>";
-
}
我們還可以在a標籤中嵌套函數,然後寫入自己的邏輯