解决方案 »
- SWFObject is undefined 未定义
- 哪位仁兄能帮我讲解下,这几个js函数,要逐语句讲解。。谢谢!
- 后台数据传递到前台的问题,主要是写法的问题
- 请教:jsp文件通过post传递很大字符串出现Form content truncated
- 帮忙看看这个联动菜单有什么问题 简单问题我不会~~~
- easyui 点击according创建tab
- 请问这个循环的语法错在哪里?
- 有没有这样的菜单:点击一个父菜单展开相应的子菜单,同时关闭其他已展开的菜单,也就是每次只展开一个父菜单及其子菜单,万分感谢,当然只能
- 有没有办法实现截屏功能?与按下Print Screen键一样的效果
- js 无法获取 textarea 内容
- 锋利的JQUERY中讲的AJAX是不是有问题?
- jquery easyui中DataGrid DetailView加减号怎么去掉,如图:
return "<a href='javascript:void(0)' onclick='addryxx("+index+")' >编辑</a>"
var editIndex=-1;
function addryxx(index){
var row= $('#fzmc').datagrid('getRows')[index];
//打开dialog,给你的dialog里面的表单赋值什么的
editIndex=index;//////////更新正在编辑的数据下标
}dialog的保存后获取表单数据,调用updateRow更新datagrid数据
function save(){
$('#fzmc').datagrid('updateRow',{index:editIndex,row:{/*字段名和表单的键值对对象*/}}
}updateRow param Update the specified row, the param contains following properties:
index: the row index to be updated.
row: the new row data.Code example:$('#dg').datagrid('updateRow',{
index: 2,
row: {
name: 'new name',
note: 'new note message'
}
});
有空对看下API,http://www.jeasyui.com/documentation/index.php
var editIndex=-1;
function addryxx(index){
var row= $('#fzmc').datagrid('getRows')[index];
editIndex=index;
$('#window').window({
title:'编辑分组人员信息',
width:350,
height:400,
modal:true,
});
if(row){
if(row.xm){
document.getElementById("xm").value = row.xm;
}
if(row.xb){
document.getElementById("xb").value = row.xb;
} if(row.sfzhm){
document.getElementById("sfzhm").value = row.sfzhm;
}
if(row.csny){
document.getElementById("csny").value = row.csny;
}
if(row.dz){
document.getElementById("dz").value = row.dz;
}
if(row.mz){
document.getElementById("mz").value = row.mz;
}
if(row.lxdh){
document.getElementById("lxdh").value = row.lxdh;
}
if(row.bm){
document.getElementById("bm").value = row.bm;
}
}
}
function checkboxsave(){
$('#fzmc').datagrid('updateRow',{index:editIndex,row:{
xm:document.getElementById("xm").value,
xb:document.getElementById("xb").value,
sfzhm:document.getElementById("sfzhm").value,
csny:document.getElementById("csny").value,
dz:document.getElementById("dz").value ,
mz:document.getElementById("mz").value,
lxdh:document.getElementById("lxdh").value,
bm:document.getElementById("bm").value
}});
$('#window').window('close');
// $('#fzmc').datagrid('reload');
}
----------------------------------
if(row){ 这的row是指所有行,而不是单击的这一行 ,导致窗口里面原有的数据混乱了 用什么方法让它指定行
if(row.xm){
document.getElementById("xm").value = row.xm;
}
如果这一行的“xm”为空的话 它还会显示出其他行的“xm”
。。
这个怎么搞啊 想了好久了
搞了一晚上了 都搞不定
你做了删除操作?要不不可能后去到其他行的数据的。如果确实是做了删除操作。。删除的记录在你编辑的数据行前面确实会导致获取到下一行的数据(删除越多越推后)不行你传递此行的id进入addryxx,遍历所有数据获取到自定的数据行,这样就不怕删除了return "<a href='javascript:void(0)' onclick='addryxx("+row["你的id列名称"]+")' >编辑</a>"var rowId=-1
function addryxx(id){
var rows= $('#fzmc').datagrid('getRows'),row=false;
for(var i=0;i<rows.length;i++)if(rows[i]["id键名称"]==id){row=rows[i];break;}
if(row==false){alert('找不到编辑的数据行!');return}
rowId=id;///////save也差不多,通过id找到row,代码和上面一样,然后调用getRowIndex 得到编辑的数据行下标,注意数据行id和编辑的数据行下标不是同一个东西
return "<a href='javascript:void(0)' onclick='addryxx("+row["你的id列名称"]+")' >编辑</a>"
row["你的id列名称"] 这个是什么啊 这个表没有id啊 你能详细点不 。。我菜鸟
你数据表没有id键吗?将id键一起放到json字符串中发送到客户端。。要不传递身份证那个列值应该也是唯一的,身份证应该没有重复的。要是有重复的你只能用id键了