为Grid配置了Ext.grid.CheckboxSelectionModel()属性,但达不到想的效果,去查看了源码,也没看出个所以然,请教各位前辈,用什么方法可以实现以下两种效果:
1.点击记录只改变背景色,不改变选择状态。要想选中,只能去点击checkbox
2.点击记录,选中该记录,但不改变其它已选中记录的状态。
源码:
gridJson.js
// ext-grid.2.x Ext.onReady(function(){ /*===================== 判断红男绿女 =====================*/ /*===================== 察看详细 =====================*/ /*===================== 二维数组 =====================*/ /* ArrayReader cm.defaultSortable = true; // 设置列可排序 var grid = new Ext.grid.GridPanel({ }) |
gridJsonData.jsp
<% String start = request.getParameter("start"); String limit = request.getParameter("limit"); //String start = "0"; //String limit = "100"; try { int index = Integer.parseInt(start); int pageSize = Integer.parseInt(limit); String json = "{totalProperty:100,root:["; for (int i = index; i < pageSize + index; i++) { json += "{id:" + i + ",name:'name" + i + "',descn:'descn" + i + "'}"; if (i != pageSize + index - 1) { json += ","; } } json += "]}"; response.getWriter().write(json); } catch(Exception ex) { } %> |
grid.jsp
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %> <!-- Base css and patch--> </head> <body> <table width="600" border="0" align="center" cellpadding="0" cellspacing="0"> |