开发者

can jquery datatable inject controls (filter,pagination...) into an existing div?

开发者 https://www.devze.com 2023-01-31 13:04 出处:网络
Jquery datatables plugin generates a series of controls (filter,pagination...) directly above or below the actual table. I need the generated filter to be injected into a preexisting div. The sdom opt

Jquery datatables plugin generates a series of controls (filter,pagination...) directly above or below the actual table. I need the generated filter to be injected into a preexisting div. The sdom option doesn't do the trick, it only generates another such div with that id.

example, using this sdom:

"sDom": '<"#myexistingfilterdiv_id"f>'
开发者_Go百科

leads to 2 divs with same id (this first is generated, the second is preexisting):

<div id="myexistingfilterdiv_id">
generated filter html
</div>

<div id="myexistingfilterdiv_id">
my preexisting empty div
</div>

I would like the generated filter html to be generated inside the preexisting div.


You can't do quite what you're asking, but what you can do is detach the <div id="myexistingfilterdiv_id"> after the datatable is generated and reattach it somewhere else. I'm not sure what else that is likely to break tho. Why do you want to move it?

0

精彩评论

暂无评论...
验证码 换一张
取 消