English 中文(简体)
数据表 sDom 挑战在表格左下端添加新元素
原标题:Datatables sDom challenge add new element to bottom left of table

我想在桌子底部的桌子上添加一个“再生”按钮。但我刚刚开始使用数据表,而且数据表有点混乱,就像“SDOM”部分一样,它说我可以通过这个来做到这一点,这意味着,但描述充其量是模糊的。

"sDom":  <"top"i>rt<"bottom"flp><"clear"> 

数据表. net 示例, 但我不知道如何制造头部或尾部, 我只想做一件简单的事情。

还是有"SDOM"的外表 更适合我想做的事?

最佳回答

s 这里是一个修改过 sDom 的活的例子。

http://lip.databables.net/onaqul/edit#javascript,html,life>http://lip.databables.net/onaqul/edit#javastant,html,lip

我们在此插入一个叫做 div 的 , 其结构为 lt; "#rerefresh" & gt;

    $( #example ).dataTable({
        "sDom":  <"top"i>rt<"bottom"<"#refresh">flp><"clear"> 
      });

If you inspect the generated dom in the example, you can see <div id="refresh"></div> got inserted inside of <div class="bottom"></div>.

我想这在很大程度上取决于:(1) 您的具体表格中是否有其页脚元素;(2) 您决定使用 < a href=> http://databables.net/usage/options#sDom>>sDom 来输入您的具体元素;(3) 您如何用您的 < code> CSS 来对元素进行样式。

或者,您可以在数据表格环境之外创建一个按钮,但使用 jquery 将您的按钮附加或插入到 Dom 元素数据表格所创建的按钮上。

希望这是一个有益的起点。

问题回答

我同意你的看法,即数据表 < code> sDom 属性令人困惑。 我个人刚刚设定了等于 < code> t < /code> 的 < code>, 等于 < code> t < /code>, 仅创建表格, 我使用 jQuery 或其他方法添加任何按钮或数据表代码之外的东西。 答案不多, 但如果我处于你的处境, 并且想要做简单的事情, 比如添加按钮, 我也会这样做 。





相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签