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

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

问题描述

使用 jQuery DataTables插件动态添加行时,如果其中一个单元格必须是说,一个复选框?只是把HTML引用在引号中?

解决方案

Ok现在我知道这是我正在使用的插件。 b
$ b

我在服务器上做过我,但你应该在列中写入html。



我将尝试一个例子几分钟。



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

 CheckBox:\\\\\\

然而,这应该是有效的。

  dataTable.fnAddData(['< input type =复选框name =vehiclevalue =Bike/>','SomeOtherDataForAnotherColumn']); 


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.

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\"\u003e\u003c/input\u003e"

However this should work

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

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

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