contenteditable 换行datagrid 怎么销毁所有行

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
您的访问请求被拒绝 403 Forbidden - ITeye技术社区
您的访问请求被拒绝
亲爱的会员,您的IP地址所在网段被ITeye拒绝服务,这可能是以下两种情况导致:
一、您所在的网段内有网络爬虫大量抓取ITeye网页,为保证其他人流畅的访问ITeye,该网段被ITeye拒绝
二、您通过某个代理服务器访问ITeye网站,该代理服务器被网络爬虫利用,大量抓取ITeye网页
请您点击按钮解除封锁&<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
您的访问请求被拒绝 403 Forbidden - ITeye技术社区
您的访问请求被拒绝
亲爱的会员,您的IP地址所在网段被ITeye拒绝服务,这可能是以下两种情况导致:
一、您所在的网段内有网络爬虫大量抓取ITeye网页,为保证其他人流畅的访问ITeye,该网段被ITeye拒绝
二、您通过某个代理服务器访问ITeye网站,该代理服务器被网络爬虫利用,大量抓取ITeye网页
请您点击按钮解除封锁&easyui行编辑_百度文库
两大类热门资源免费畅读
续费一年阅读会员,立省24元!
easyui行编辑
上传于||暂无简介
阅读已结束,如果下载本文需要使用0下载券
想免费下载更多文档?
定制HR最喜欢的简历
下载文档到电脑,查找使用更方便
还剩11页未读,继续阅读
定制HR最喜欢的简历
你可能喜欢jquery easyui datagrid的增加,修改,删除
jquery easyui datagrid的增加,修改,删除
&&&&&id="form1"&runat="server"&&
&&&&&id="tt"&&
&&&&&&&&&&
&form id="form1" runat="server"&
&table id="tt"&
&link&rel="stylesheet"&type="text/css"&href="/script/themes/default/easyui.css"&/&&&
&&&&&link&rel="stylesheet"&type="text/css"&href="/script/themes/icon.css"&/&&&
&&&&&script&type="text/javascript"&src="/script/jquery-1.4.2.min.js"&&/script&&&
&&&&&script&type="text/javascript"&src="/script/jquery.easyui.min.js"&&/script&&&
&&&&&script&type="text/javascript"&src="/script/locale/easyui-lang-zh_CN.js"&mce_src="script/locale/easyui-lang-zh_CN.js"&&/script&&&&&link
rel="stylesheet" type="text/css"
href="/script/themes/default/easyui.css" /&
&link rel="stylesheet" type="text/css"
href="/script/themes/icon.css" /&
&script type="text/javascript"
src="/script/jquery-1.4.2.min.js" &/script&
&script type="text/javascript"
src="/script/jquery.easyui.min.js" &/script&
&script type="text/javascript"
src="/script/locale/easyui-lang-zh_CN.js"
mce_src="script/locale/easyui-lang-zh_CN.js"&&/script&
&script&type="text/javascript"&&!--&&
&&&&&&&&$(function(){&&
&&&&&&&&&&&&$('#tt').datagrid({&&
&&&&&&&&&&&&&&&&width:810,&&
&&&&&&&&&&&&&&&&height:400,&&
&&&&&&&&&&&&&&&&idField:'xsbh',&&
&&&&&&&&&&&&&&&&url:'studentHandler.ashx',&&
&&&&&&&&&&&&&&&&singleSelect:true,&&
&&&&&&&&&&&&&&&&columns:[[&&
&&&&&&&&&&&&&&&&&&&{field:'xsbh',title:'编号',width:80},&&
&&&&&&&&&&&&&&&&&&{field:'UserName',title:'姓名',width:100},&&
&&&&&&&&&&&&&&&&&&{field:'Sex',title:'性别',width:30},&&
&&&&&&&&&&&&&&&&&&{field:'SchoolYear',title:'年份',width:50},&&
&&&&&&&&&&&&&&&&&&{field:'opt',title:'操作',width:100,align:'center',&&
&&&&&&&&&&&&&&&&&&&&formatter:function(value,rec,index){&&
&&&&&&&&&&&&&&&&&&&&&&&&var&s&=&'&a&href="#"&mce_href="#"&onclick="view(\''+&rec.xsbh&+&'\')"&查看&/a&&';&&
&&&&&&&&&&&&&&&&&&&&&&&&var&e&=&'&a&href="#"&mce_href="#"&onclick="edit(\''+&rec.xsbh&+&'\')"&编辑&/a&&';&&
&&&&&&&&&&&&&&&&&&&&&&&&var&d&=&'&a&href="#"&mce_href="#"&onclick="del(\''+&index&+'\')"&删除&/a&&';&&
&&&&&&&&&&&&&&&&&&&&&&&&return&s+e+d;&&
&&&&&&&&&&&&&&&&&&&&}&&
&&&&&&&&&&&&&&&&&&}&&
&&&&&&&&&&&&&&&&]],&&
&&&&&&&&&&&&&&&&toolbar:[{&&
&&&&&&&&&&&&&&&&&&&&text:'增加',iconCls:'icon-add',handler:function(){&&
&&&&&&&&&&&&&&&&&&&&&&&&window.location.href='StuAdd.aspx';&&
&&&&&&&&&&&&&&&&&&&&}&&
&&&&&&&&&&&&&&&&},&&
&&&&&&&&&&&&&&&&{text:'导入',iconCls:'icon-add',handler:function(){&&
&&&&&&&&&&&&&&&&&&&&window.location.href='StuImport.aspx'&&
&&&&&&&&&&&&&&&&&&&&}&&
&&&&&&&&&&&&&&&&},&&
&&&&&&&&&&&&&&&&{text:'查找',iconCls:'icon-search'}&&
&&&&&&&&&&&&&&&&],&&
&&&&&&&&&&&&&&&pagination:true&&
&&&&&&&&&&&&});&&
&&&&&&&&})&&
&&&&&&&&&&
&&&&&&&&&&function&view(bh)&&&&
&&&&&&&&&&&&{&&
&&&&&&&&&&&&&&&&window.location.href='StuView.aspx?id='+bh+'&page=stu';&&
&&&&&&&&&&&&}&&
&&&&&&&&&&function&edit(bh)&&&&
&&&&&&&&&&{&&
&&&&&&&&&&&&&&&&window.location.href='StuEdit.aspx?id='+&&
&&&&&&&&&&}&&
&&&&&&&&&&&&
&&&&&&&&&&function&del(index){&&&&
&&&&&&&&&&&&$.messager.confirm('确认','确认删除?',function(row){&&
&&&&&&&&&&&&&&&&if(row){&&
&&&&&&&&&&&&&&&&&&&&var&selectedRow&=&$('#tt').datagrid('getSelected');&&&&
&&&&&&&&&&&&&&&&&&&&$.ajax({&&
&&&&&&&&&&&&&&&&&&&&&&&&url:'delHandler.ashx?id='+selectedRow.xsbh+'&type=stu',&&&&
&&&&&&&&&&&&&&&&&&&&&&&&success:function(){alert('删除成功');}&&
&&&&&&&&&&&&&&&&&&&&});&&
&&&&&&&&&&&&&&&&&&&&$('#tt').datagrid('deleteRow',index);&&
&&&&&&&&&&&&&&&&}&&
&&&&&&&&&&&&})&&
&&&&&&&&&&}&&
&&&script type="text/javascript"&&!--
$(function(){
$('#tt').datagrid({
width:810,
height:400,
idField:'xsbh',
url:'studentHandler.ashx',
singleSelect:true,
columns:[[
{field:'xsbh',title:'编号',width:80},
{field:'UserName',title:'姓名',width:100},
{field:'Sex',title:'性别',width:30},
{field:'SchoolYear',title:'年份',width:50},
{field:'opt',title:'操作',width:100,align:'center',
formatter:function(value,rec,index){
var s = '&a href="#" mce_href="#" onclick="view(\''+ rec.xsbh + '\')"&查看&/a& ';
var e = '&a href="#" mce_href="#" onclick="edit(\''+ rec.xsbh + '\')"&编辑&/a& ';
var d = '&a href="#" mce_href="#" onclick="del(\''+ index +'\')"&删除&/a& ';
return s+e+d;
toolbar:[{
text:'增加',iconCls:'icon-add',handler:function(){
window.location.href='StuAdd.aspx';
{text:'导入',iconCls:'icon-add',handler:function(){
window.location.href='StuImport.aspx'
{text:'查找',iconCls:'icon-search'}
pagination:true
function view(bh)
//转到查看页面
window.location.href='StuView.aspx?id='+bh+'&page=stu';
var row = $('#tt').datagrid('getSelected');
alert(row.xsbh);
function edit(bh)
//转到编辑页面
window.location.href='StuEdit.aspx?id='+
function del(index){
//删除操作
$.messager.confirm('确认','确认删除?',function(row){
var selectedRow = $('#tt').datagrid('getSelected');
//获取选中行
url:'delHandler.ashx?id='+selectedRow.xsbh+'&type=stu',
//加了个type,作用是以后不管什么删除,都可以转到这个ashx中处理
success:function(){alert('删除成功');}
$('#tt').datagrid('deleteRow',index);
// --&&/script&
&这里面要注意的是,"操作"的跨行,一定要带上field:'opt',当然,field可以是任何值,这个值不用从数据库中绑定,随便取.如果没有field的话,会弹出 "rowspan为空或不是对象"的错误
获取数据和分页ashx:
using&System.W&&
using&System.D&&
using&System.T&&
public&class&studentHandler&:&IHttpHandler&{&&
&&&&public&void&ProcessRequest&(HttpContext&context)&{&&
&&&&&&&&context.Response.ContentType&=&"text/plain";&&
&&&&&&&&DataSet&ds&=&new&DataSet();&&
&&&&&&&&&&
&&&&&&&&int&row&=&int.Parse(context.Request["rows"].ToString());&&
&&&&&&&&int&page&=&int.Parse(context.Request["page"].ToString());&&
&&&&&&&&ds&=&GetContent(row,&page);&&
&&&&&&&&string&text&=json.Dataset2Json(ds);&&
&&&&&&&&context.Response.Write(text);&&
&&&&private&DataSet&GetContent(int&pagesize,int&pageindex)&&
&&&&&&&&Graduate.BLL.Student&bll&=&new&Graduate.BLL.Student();&&
&&&&&&&&return&bll.GetList(pagesize,&pageindex);&&
&&&&public&bool&IsReusable&{&&
&&&&&&&&get&{&&
&&&&&&&&&&&&return&false;&&
&&&&&&&&}&&
}&&using S
using System.W
using System.D
using System.T
public class studentHandler : IHttpHandler {
public void ProcessRequest (HttpContext context) {
context.Response.ContentType = "text/plain";
DataSet ds = new DataSet();
//点击datagrid的分页按钮,自动向后台发送2个参数,rows和page,代表每页记录数和页索引
int row = int.Parse(context.Request["rows"].ToString());
int page = int.Parse(context.Request["page"].ToString());
ds = GetContent(row, page);
string text =json.Dataset2Json(ds);
context.Response.Write(text);
private DataSet GetContent(int pagesize,int pageindex)
Graduate.BLL.Student bll = new Graduate.BLL.Student();
return bll.GetList(pagesize, pageindex);
public bool IsReusable {
using&System.W&&
using&System.Web.SessionS&&
public&class&delHandler&:&IHttpHandler,IRequiresSessionState&{&&
&&&&public&void&ProcessRequest&(HttpContext&context)&{&&
&&&&&&&&context.Response.ContentType&=&"text/plain";&&
&&&&&&&&string&id&=&context.Request["id"].ToString();&&
&&&&&&&&string&type&=&context.Request["type"].ToString();&&
&&&&&&&&switch&(type)&&
&&&&&&&&{&&&
&&&&&&&&&&&&case&"stu":&&
&&&&&&&&&&&&&&&&Graduate.BLL.Student&stubll&=&new&Graduate.BLL.Student();&&
&&&&&&&&&&&&&&&&stubll.Delete(id,&HttpContext.Current.Session["username"].ToString(),&HttpContext.Current.Session["usertype"].ToString());&&
&&&&&&&&&&&&&&&&break;&&
&&&&&&&&&&&&default:&&
&&&&&&&&&&&&&&&&break;&&
&&&&&&&&}&&
&&&&public&bool&IsReusable&{&&
&&&&&&&&get&{&&
&&&&&&&&&&&&return&false;&&
&&&&&&&&}&&
using System.W
using System.Web.SessionS
public class delHandler : IHttpHandler,IRequiresSessionState {
public void ProcessRequest (HttpContext context) {
context.Response.ContentType = "text/plain";
string id = context.Request["id"].ToString();
string type = context.Request["type"].ToString();
switch (type)
case "stu":
Graduate.BLL.Student stubll = new
Graduate.BLL.Student();
stubll.Delete(id,
HttpContext.Current.Session["username"].ToString(),
HttpContext.Current.Session["usertype"].ToString());
public bool IsReusable {
IRequiresSessionState 是因为用到了服务器端的session,没有用到的话可以去掉
加载相关js和css,因为easyui依赖jquery,所有加载easyui前要先加载jquery,否则为提示找不到datagrid
&&&&&&&&&type="text/javascript"&src="plugins/jquery/jquery-1.4.2.min.js"&&
&&&&&&&&&&
&&&&&&&&&rel="stylesheet"&type="text/css"&href="plugins/jquery/jquery-easyui-1.1.2/themes/default/easyui.css"&&
&&&&&&&&&rel="stylesheet"&type="text/css"&href="plugins/jquery/jquery-easyui-1.1.2/themes/icon.css"&&
&&&&&&&&&type="text/javascript"&src="plugins/jquery/jquery-easyui-1.1.2/jquery.easyui.min.js"&&&!-- 加载jquery --&
&script type="text/javascript" src="plugins/jquery/jquery-1.4.2.min.js"&&/script&
&!-- 加载jquery-easyui --&
&link rel="stylesheet" type="text/css" href="plugins/jquery/jquery-easyui-1.1.2/themes/default/easyui.css"&
&link rel="stylesheet" type="text/css" href="plugins/jquery/jquery-easyui-1.1.2/themes/icon.css"&
&script type="text/javascript" src="plugins/jquery/jquery-easyui-1.1.2/jquery.easyui.min.js"&&/script&
&id="cxdm"&&&table id="cxdm"&&/table&
加载datagrid的js代码
$(document).ready(function(){&&
&&&&&&&&&&&&loadGrid();&&
function&loadGrid()&&
&&&&$('#cxdm').datagrid({&&
&&&&&&&&&&&&&&&&width:&'auto',&&
&&&&&&&&&&&&&&&&height:300,&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&striped:&true,&&
&&&&&&&&&&&&&&&&singleSelect&:&true,&&
&&&&&&&&&&&&&&&&url:'getPsNewConsultList.action',&&
&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&loadMsg:'数据加载中请稍后……',&&
&&&&&&&&&&&&&&&&pagination:&true,&&
&&&&&&&&&&&&&&&&rownumbers:&true,&&&&&
&&&&&&&&&&&&&&&&columns:[[&&
&&&&&&&&&&&&&&&&&&&&{field:'adviceid',title:&'来文号',align:&'center',width:&getWidth(0.2)},&&
&&&&&&&&&&&&&&&&&&&&{field:'consulter',title:&'案由',align:&'center',width:&getWidth(0.45),&&
&&&&&&&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&&&&&&&&formatter:function(val,rec){&&
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&&&&&&&&&&&&return&"&a&href='jsp/proposal/psconsultview.jsp?id="+rec.adviceid+"'&"+val+"&/a&";&&
&&&&&&&&&&&&&&&&&&&&&&&}&&
&&&&&&&&&&&&&&&&&&&&},&&
&&&&&&&&&&&&&&&&&&&&{field:'content',title:&'状态',align:&'center',width:&getWidth(0.2)},&&
&&&&&&&&&&&&&&&&&&&&{field:'replynumber',title:&'回复数',align:&'center',width:&getWidth(0.05)}&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&]]&&
&&&&&&&&&&&&});&&
&&&&&&&&var&queryParams&=&$('#cxdm').datagrid('options').queryP&&
&&&&&&&&queryParams.who&=&who.&&
&&&&&&&&queryParams.type&=&type.&&
&&&&&&&&queryParams.searchtype&=&searchtype.&&
&&&&&&&&queryParams.keyword&=&keyword.&&
&&&&&&&&&&
&&&&&&&&$("#cxdm").datagrid('reload');&&
发表评论:
TA的最新馆藏[转]&[转]&[转]&[转]&

我要回帖

更多关于 x editable 增删行 的文章

 

随机推荐