|
楼主 |
发表于 2014-6-3 17:34:41
|
显示全部楼层
已经解决了。。。把解决办法留下给需要的人
首先把choose控件里的值 传给 datagrid页面
datagrid页面代码:- <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
- <%@include file="/context/mytags.jsp"%>
- <!DOCTYPE html >
- <html>
- <head>
- <title>e</title>
- <t:base type="jquery,easyui,tools"></t:base>
- </head>
- <body style="overflow-y: hidden" scroll="no">
- <%
- String tagNames = (String) request.getAttribute("tagName1");
- %>
- <t:datagrid name="tagList" title="按协议选择" actionUrl="xxxx.do?datagridTag" pagination="false" idField="id" checkbox="true" showRefresh="false" onLoadSuccess="onchecked()">
- <t:dgCol title="标记ID" field="id" hidden="false"></t:dgCol>
- <t:dgCol title="标记名称" field="tagENName" width="50" ></t:dgCol>
- </t:datagrid>
- </body>
- </html>
- <script type="text/javascript">
- function onchecked(){
- var tagNames = "<%=tagNames%>";
- var tagList = tagNames.split(",");
- var rows = $('#tagList').datagrid('getRows')//获取当前的数据行
- var total = 0;
- for (var j = 0; j < tagList.length; j++) {
- for (var i = 0; i < rows.length; i++) {
- if(tagList[j] == rows[i]['tagENName']) {
- $('#tagList').datagrid('selectRow', i);
- }
- }
- }
- }
- </script>
复制代码 |
|