Easyui How to add hyperlinks per row in the DataGrid

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.