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)!