var rowData =$("#priTB").datagrid("getRows")[index];
$(function(){
var lastIndex;
/**
现在这里获取row里面的值
**/
<body>
<div class="easyui-layout" data-options="fit:true,border:false">
<div
data-options="region:'north',title:'查询条件',border:false,noheader:true"
style="height:auto;padding:0px 4px 0px 4px;background:#ffffff;overflow:hidden;">
<form class="bg-border" id="searchForm" action="admin/exportApprenticeList.htm">
<table width="100%"><Tr><td>
<span>邀请码</span>
<input type="text" name="sonMemberId"/>
<span>姓名</span>
<input type="text" name="sonName"/>
<a href="javascript:;" class="easyui-linkbutton" data-options="iconCls:'icon-search'" plain="false" οnclick="doSearch()">搜索</a>
<a href="javascript:;" class="easyui-linkbutton" data-options="iconCls:''" plain="false" οnclick="doExport()">导出</a>
</td>
</tr>
</table>
</form>
</div>
<div data-options="region:'center',border:false"
style="padding-left: 4px;padding-top: 0px;padding-right: 4px;background:#ffffff;overflow:hidden;">
<table id="priTB" title="邀请记录" style="width:inherit;height:auto;"
pagination="true"
data-options="fit:true,rownumbers:true,pagination:true,remoteSort:false,pageSize:10,pageList:[1,10,20],url:$('base')[0].href+'admin/getAllApprenticeList.htm'">
<thead>
<th field="id" width="160" checkbox="true">序号</th>
<th field="sonName" width="140" sortable="true" align="center">本人</th>
<th field="sonMemberId" width="120" align="center">本人邀请码</th>
<th field="parentName" width="140" sortable="true" align="center">大师兄</th>
<th field="parentMemberId" width="120" align="center">大师兄邀请码</th>
<th field="parentScore" width="110" align="center">大师兄所获积分</th>
<th field="grandName" width="140" sortable="true" align="center">师傅</th>
<th field="grandMemberId" width="120" align="center">师傅邀请码</th>
<th field="grandScore" width="110" align="center">师傅所获积分</th>
<th field="createDate" width="120" align="center">邀请时间</th>
</thead>
</table>
</div>
</div>
<script type="text/javascript">
function doSearch(){
$("#priTB").datagrid("load", serializeObject($("#searchForm")));
}
function dele(id) {
$.messager.confirm("提示", "您确认要删除吗?",
function(b) {
if (b) {
$.ajax({
url: $("base")[0].href + "admin/deleteInvite.htm",
type: "post",
data: {
inviteId: id
},
dataType: "json",
async: false,
success: function(data) {
//删除失败
if (data.status == '1') {
$("#priTB").datagrid("reload");
}else{
$.messager.alert("提示", "删除失败");
}
}
});
}
});
}
$(function(){
var lastIndex;
$('#priTB').datagrid({
toolbar:[
],
onBeforeLoad:function(){
$(this).datagrid('rejectChanges');
},
onClickRow:function(rowIndex){
if (lastIndex != rowIndex){
$('#priTB').datagrid('endEdit', lastIndex);
$('#priTB').datagrid('beginEdit', rowIndex);
}
lastIndex = rowIndex;
}
});
});
function doExport(){
$("#searchForm").submit();
}
</script>
</body>