简体   繁体   中英

DataTables how to Custom toolbar elements without loss pagelength,button elements

I saw this DataTable Example explaining custom toolbar elements.

However, when I set:

"dom": '<"toolbar">frtip'

then my toolbar will lose "pagelength" and button,

How can I Custom toolbar elements without loss pagelength and button elements?

You must include l in toolbar dom. to get pagelength element.

other built-in table control elements in DataTables are:

l - l ength changing input control

f - f iltering input

t - The t able!

i - Table i nformation summary

p - p agination control

r - p r ocessing display element

similarly use can use markup options to add classes and id's

< and > - div element

<"class" and > - div with a class

<"#id" and > - div with an ID

<"#id.class" and > - div with an ID and a class

Below is a code snippet i have used in my datatable to positioning different controls :

dom:" <'row'<'col-sm-4'f>><'row'<'col-sm-12'tr>><'row'<'col-sm-2'l><'col-sm-6'i><'col-sm-4'p>>"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM