jQuery DataTables 插件:动态添加复选框 [英] jQuery DataTables plugin: adding a checkbox dynamically

查看:49
本文介绍了jQuery DataTables 插件:动态添加复选框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用 jQuery DataTables 插件动态添加一行时,如果其中一个单元格必须添加,我该怎么办比如说,一个复选框?只是将 HTML 放在引号中?

When adding a row dynamically using jQuery DataTables plugin, what do I do if one of the cells has to be, say, a checkbox? Just put the HTML in quotes?

推荐答案

现在我知道这是我正在使用的插件.

Ok now I know it is the plugin that I am using.

我在服务器上做了我的,但你应该只在列中写 html.

I did mine on the server but you should just write the html in the column.

我会在几分钟内尝试做一个例子.

I will try to make an example in a few minutes.

这是我的复选框来自服务器的方式

This is how my checkbox comes from the server

"CheckBox":"u003cinput type="checkbox"u003eu003c/inputu003e"

但是这应该有效

dataTable.fnAddData(['<input type="checkbox" name="vehicle" value="Bike" />','SomeOtherDataForAnotherColumn']);

这篇关于jQuery DataTables 插件:动态添加复选框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆