Easyui--datagrid's Onclickrow Event

Source: Internet
Author: User
when doing the evaluation system of the university cloud Platform system, the student has clicked the hyperlink to realize the function of jumping and passing the value to the specified interface. Hyperlinks are not complicated to implement, but taking into account the student's user-friendly design, so the hyperlink to a single machine anywhere you can click on the hyperlink effect, that is, can jump to the specified interface and value.

By viewing the Help document, we found the Onclickrow event, which was triggered when the user clicked a line, including:

RowIndex: The index value of the row clicked, starting at 0.

RowData: The record that corresponds to the click line.

We can take the value that we want to pass through RowData, and then jump the page to the specified link, the JS code is as follows:

<span style= "FONT-FAMILY:KAITI_GB2312;FONT-SIZE:18PX;" > <script type= "Text/javascript" > $ ("#dg"). DataGrid ({Onclickrow:functi On (index, row) {//easyui encapsulated time (index of stand-alone row, value of clicked Row)//value to be passed var coursename = row["Cou                    Rsename "];                    var Teachercourseid = row["Teachercourseid"];                    var assessstatus = row["Assessstatus"]; if (assessstatus== "not yet evaluated")//If the item has not been evaluated, then support jumps to the evaluation page {var url = ". /evaluationstudentassess/studentassess? Coursename= "+ coursename +" &teachercourseid= "+ Teachercourseid} else {//if The item is evaluated without the need to jump var url = ".                    /evaluationstudentassess/assessstatus "}//value via Ajax                        $.ajax ({url:url, type: ' POST ',timeout:100, Error:function () {alert (Error);                        }, Success:function () {window.location.href = URL                    }                    });        }            }); </script></span>

In fact, the implementation is not complicated, there are many times we record some more, you can give users a permanent simple operation, wholeheartedly for the people are every programmer should be the purpose of the bank.

Of course, there are more than one way, the above is my personal thought of the method, there are shortcomings please criticize correct, there are other ways to welcome the exchange at any time.

The above is Easyui--datagrid's Onclickrow event content, more relevant content please pay attention to topic.alibabacloud.com (www.php.cn)!

  • Related Article

    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.