用jQuery动态添加行怎么没添加成功,后台数据都有了,前端代码不知道哪里写错了

Cloud_1989 2015-01-13 06:15:27
公司用的是easyui,但是我不会,所以就用jQuery写的,后台数据我看都是对的,就是那句添加语句不知道哪里写错了
然后就是没添加进去,求大神帮我看看错在哪里
以下是代码





...全文
254 5 打赏 收藏 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
weixin_43311352 2018-09-29
  • 打赏
  • 举报
回复
你赋值给变量,而没有给它本身,直接用$('#tbody').append
Hello World, 2015-01-14
  • 打赏
  • 举报
回复
都已经生成datagrid了,直接在原来的表上添加新行是显示不了的
  • 打赏
  • 举报
回复
自己好好看DataGrid的API http://www.jeasyui.com/documentation/index.php appendRow row Append a new row. The new row will be added to the last position:

$('#dg').datagrid('appendRow',{
	name: 'new name',
	age: 30,
	note: 'some messages'
});
insertRow param Insert a new row, the param contains following properties: index: the row index to insert into, if not defined, append the new row. row: the row data. Code examples:
// insert a new row at second row position
$('#dg').datagrid('insertRow',{
	index: 1,	// index start with 0
	row: {
		name: 'new name',
		age: 30,
		note: 'some messages'
	}
});
Cloud_1989 2015-01-13
  • 打赏
  • 举报
回复
格式我是对的 data 我不需要传参数 可以不写的
slwsss 2015-01-13
  • 打赏
  • 举报
回复
$.post(url,data,function(){},'json')

87,984

社区成员

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

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