One of the requirements of the Guang Zhong Project is to use the Easyui framework to add a hyperlink to a grid on each row, such as:
In that column, every line is a hyperlink, usually we are through field, binding data obtained from the background, if there is no special requirements, it can be used, but to the format of the data, there are attributes (such as adding some hyperlinks), This is going to use a easyui inside the formatter property, its value is a function, the function has three parameters, respectively, is value,row,index. Here are some of these parameters:
1, Value: is the value of the current field bound data, for example, I am currently bound by this field is a property named ID, then this value is the current line of this ID values
2. RowData: All data on the current line, including displayed and not displayed
3. Index: The row value of the first row
So how does this function work? Here is a brief introduction to my project:
function Getmorerecent () {$ (' #filedGrid '). DataGrid ({title: "Case submitted by the filing Secretary", URL: "/arbcase/api/pageclicklog/ Recentcasetoplist ", columns:[[{field: ' Collectno ', title: ' Case Number ', Width:100,formatter:function (value,row,index) { Return ' <a style= ' Color:blue "href="/arbcase/case-' +row.id+ ' "> ' +row.collectno+ ' </a> '; } }, {field: ' Nature ', title: ' Width:100} ', {field: ' Accuserlisttext ', title: ' Applicant ', Width:100},{field: ' Appellelisttext ', title: ' Respondent ', Width:100},{field: ' Createddatetimetext ', title: ' Entry Time ', width:50}]});}
The above code is characterized by that the URL can be passed through the variable, the second column of the number of rows can be automatically set, but also the data format for each column can be converted, like me this is to return a hyperlink, presumably this is the case
Easyui How to add hyperlinks per row in the DataGrid