请问jquery easyui datagrid detailview获取datagrid 的index

zzbutcher 2014-09-22 02:25:43

我的问题是 如何在save的时候 得到表格的index,
因为在save的时候 需要知道detailview是属于datagrid的哪一行,easyui官网的例子用的是php

网站上的例子使用的是这个方法 saveItem(<?php echo $_REQUEST['index'];?>)

请问用java实现 saveItem(<?php echo $_REQUEST['index'];?>)这句的功能,怎么搞,或者有没有别的方法去获取表格的index

下面是easyui网站上的例子

地址是 http://www.jeasyui.com/tutorial/app/crud3.php
<table id="dg" title="My Users" style="width:550px;height:250px"
url="get_users.php"
toolbar="#toolbar"
fitColumns="true" singleSelect="true">
<thead>
<tr>
<th field="firstname" width="50">First Name</th>
<th field="lastname" width="50">Last Name</th>
<th field="phone" width="50">Phone</th>
<th field="email" width="50">Email</th>
</tr>
</thead>
</table>
<div id="toolbar">
<a href="#" class="easyui-linkbutton" iconCls="icon-add" plain="true" onclick="newItem()">New</a>
<a href="#" class="easyui-linkbutton" iconCls="icon-remove" plain="true" onclick="destroyItem()">Destroy</a>
</div>


$('#dg').datagrid({
view: detailview,
detailFormatter:function(index,row){
return '<div class="ddv"></div>';
},
onExpandRow: function(index,row){
var ddv = $(this).datagrid('getRowDetail',index).find('div.ddv');
ddv.panel({
border:false,
cache:true,
href:'show_form.php?index='+index,
onLoad:function(){
$('#dg').datagrid('fixDetailRowHeight',index);
$('#dg').datagrid('selectRow',index);
$('#dg').datagrid('getRowDetail',index).find('form').form('load',row);
}
});
$('#dg').datagrid('fixDetailRowHeight',index);
}
});


<form method="post">
<table class="dv-table" style="width:100%;background:#fafafa;padding:5px;margin-top:5px;">
<tr>
<td>First Name</td>
<td><input name="firstname" class="easyui-validatebox" required="true"></input></td>
<td>Last Name</td>
<td><input name="lastname" class="easyui-validatebox" required="true"></input></td>
</tr>
<tr>
<td>Phone</td>
<td><input name="phone"></input></td>
<td>Email</td>
<td><input name="email" class="easyui-validatebox" validType="email"></input></td>
</tr>
</table>
<div style="padding:5px 0;text-align:right;padding-right:30px">
<a href="#" class="easyui-linkbutton" iconCls="icon-save" plain="true" onclick="saveItem(<?php echo $_REQUEST['index'];?>)">Save</a>
<a href="#" class="easyui-linkbutton" iconCls="icon-cancel" plain="true" onclick="cancelItem(<?php echo $_REQUEST['index'];?>)">Cancel</a>
</div>
</form>
...全文
160 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
csucaicai 2014-09-22
  • 打赏
  • 举报
回复
加rownumber
csucaicai 2014-09-22
  • 打赏
  • 举报
回复
你可以直接给他加index属性,就有了,之后可以获取到,有几个月没弄那个了
zzbutcher 2014-09-22
  • 打赏
  • 举报
回复
没有人知道吗,是我这个问题没有描述清楚,或者是问的太愚昧了
源码直接下载地址: https://pan.quark.cn/s/a4b39357ea24 ### 信号与系统(郑君里 第三版)课后习题解析 #### 1. 信号与系统中δ函数的尺度变换特性 在《信号与系统》(郑君里 第三版)这一著作中,作者阐述了δ函数的尺度变换特性,并借助一个特定的习题进行了详尽的阐释。该习题的任务在于验证以下等式: \[ \delta(at) = \frac{1}{|a|}\delta(t) \] **论证:** 为了验证此等式,我们首先需要掌握δ函数的基本属性以及它如何响应自变量的变动。依据题目的指示,我们知道当自变量为\( t \)时,脉冲的底部长度为\( \tau \),而当自变量转变为\( at \)时,底部长度调整为\( |a|\tau \)。 我们能够借助图形化的手段来获得直观的认识。设想一个用三角形来逼近的δ函数图像,其底边长度为\( \tau \),高度为\( h \),那么三角形的面积计算为\( A = \frac{1}{2} \tau h \)。当自变量变为\( at \)时,为了维持三角形的高度恒定,底边长度必须更新为\( |a|\tau \),此时三角形的面积变为\( A = \frac{1}{2} |a|\tau h = |a|A \)。 由于δ函数的积分特性被定义为单位面积,即在任何区间\( [-\infty, +\infty] \)内的积分结果均为1,因此无论底部长度如何变化,积分值均保持恒定。这表明,当自变量转变为\( at \)时,为了确保积分值维持在1,δ函数的幅度必须相应地调整为原值的\( \frac{1}{|a|} \)倍。由此,我们得以证明该等式: \[ \int_{-\infty}^{+\infty}...

87,987

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧