Home Wiki
JQuery DataTable Column Filter - Fixing problem with {bSortCellsTop:true}

Preamble

Live example

Filter before heading row

Company ID Company name Number of employees
Company ID Company name Number of employees
17 Emkay Entertainments 109
18 The Empire 44
19 Asadul Ltd 81
20 Gargamel ltd 20
21 Ashley Mark Publishing Company 61
22 MuchMoreMusic Studios 104
23 Victoria Music Ltd 49
24 Abacus Agent 96
25 Atomic 45
26 Pyramid Posters 96
27 Kingston Smith Financial Services Ltd 49
28 Garrett Axford PR 104
29 Derek Boulton Management 61
30 Total Concept Management (TCM) 20
31 Billy Russell Management 81
32 Stage Audio Services 44
33 Windsong International 109
34 Vivante Music Ltd 76
35 Way to Blue 45
36 Glasgow City Halls 116
37 The List 89
38 Wilkinson Turner King 64
39 GSC Solicitors 41
40 Vanessa Music Co 20
41 Regent Records 101
42 BBC Radio Lancashire 84
43 The Citadel Arts Centre 69
44 Villa Audio Ltd 56
45 Astra travel 45
46 Idle Eyes Printshop 36
47 Miggins Music (UK) 29
48 Magic 999 24
49 Delga Group 21
50 Zane Music 20
51 Universal Music Operations 21
52 Gotham Records 24
53 Timbuktu Music Ltd 29
54 Online Music 36
55 Irish Music Magazine 45
56 Savoy Records 56
57 Temple Studios 69
58 Gravity Shack Studio 84
59 Dovehouse Records 101
60 Citysounds Ltd 20
61 Revolver Music Publishing 41
62 Jug Of Ale 64
63 Isles FM 103 89
64 Headscope 116
65 Universal Music Ireland 45
66 Zander Exports 76
67 Midem (UK) 109
68 La Rocka Studios 44
69 Warner Home DVD 81
70 Music Room 20
71 Blue Planet 61
72 Dream 107.7FM 104
73 Moneypenny Agency 49
74 Artsun 96
75 Clyde 2 45
76 9PR 96
77 River Studio's 49
78 Start Entertainments Ltd 104
79 Vinyl Tap Mail Order Music 61
80 Passion Music 20
81 SuperVision Management 81
82 Lite FM 44
83 ISIS Duplicating Company 109
84 Vanderbeek & Imrie Ltd 76
85 Glamorgan University 45
86 Web User 116
87 Farnborough Recreation Centre 89
88 Robert Owens/Musical Directions 64
89 Magick Eye Records 41
90 Alexandra Theatre 20
91 Keda Records 101
92 Independiente Ltd 84
93 Shurwood Management 69
94 Fury Records 56
95 Northumbria University 45
96 Pop Muzik 36
97 Jonsongs Music 29
98 Hermana PR 24
99 Sugarcane Music 21
100 JFM Records 20
101 Black Market Records 21
102 Float Your Boat Productions 24
103 Creation Management 29
104 Bryter Music 36
105 The Headline Agency 45
106 MP Promotions 56
107 Modo Production Ltd 69
108 Nomadic Music 84
109 Reverb Records Ltd 101
110 SIBC 20
111 Marken Time Critical Express 41
112 102.2 Smooth FM 64
113 Chesterfield Arts Centre 89
114 The National Indoor Arena 116
115 Salisbury City Hall 45
116 Minder Music 76
Company ID Company name Number of employees

Filter after heading row

Company ID Company name Number of employees
Company ID Company name Number of employees
17 Emkay Entertainments 109
18 The Empire 44
19 Asadul Ltd 81
20 Gargamel ltd 20
21 Ashley Mark Publishing Company 61
22 MuchMoreMusic Studios 104
23 Victoria Music Ltd 49
24 Abacus Agent 96
25 Atomic 45
26 Pyramid Posters 96
27 Kingston Smith Financial Services Ltd 49
28 Garrett Axford PR 104
29 Derek Boulton Management 61
30 Total Concept Management (TCM) 20
31 Billy Russell Management 81
32 Stage Audio Services 44
33 Windsong International 109
34 Vivante Music Ltd 76
35 Way to Blue 45
36 Glasgow City Halls 116
37 The List 89
38 Wilkinson Turner King 64
39 GSC Solicitors 41
40 Vanessa Music Co 20
41 Regent Records 101
42 BBC Radio Lancashire 84
43 The Citadel Arts Centre 69
44 Villa Audio Ltd 56
45 Astra travel 45
46 Idle Eyes Printshop 36
47 Miggins Music (UK) 29
48 Magic 999 24
49 Delga Group 21
50 Zane Music 20
51 Universal Music Operations 21
52 Gotham Records 24
53 Timbuktu Music Ltd 29
54 Online Music 36
55 Irish Music Magazine 45
56 Savoy Records 56
57 Temple Studios 69
58 Gravity Shack Studio 84
59 Dovehouse Records 101
60 Citysounds Ltd 20
61 Revolver Music Publishing 41
62 Jug Of Ale 64
63 Isles FM 103 89
64 Headscope 116
65 Universal Music Ireland 45
66 Zander Exports 76
67 Midem (UK) 109
68 La Rocka Studios 44
69 Warner Home DVD 81
70 Music Room 20
71 Blue Planet 61
72 Dream 107.7FM 104
73 Moneypenny Agency 49
74 Artsun 96
75 Clyde 2 45
76 9PR 96
77 River Studio's 49
78 Start Entertainments Ltd 104
79 Vinyl Tap Mail Order Music 61
80 Passion Music 20
81 SuperVision Management 81
82 Lite FM 44
83 ISIS Duplicating Company 109
84 Vanderbeek & Imrie Ltd 76
85 Glamorgan University 45
86 Web User 116
87 Farnborough Recreation Centre 89
88 Robert Owens/Musical Directions 64
89 Magick Eye Records 41
90 Alexandra Theatre 20
91 Keda Records 101
92 Independiente Ltd 84
93 Shurwood Management 69
94 Fury Records 56
95 Northumbria University 45
96 Pop Muzik 36
97 Jonsongs Music 29
98 Hermana PR 24
99 Sugarcane Music 21
100 JFM Records 20
101 Black Market Records 21
102 Float Your Boat Productions 24
103 Creation Management 29
104 Bryter Music 36
105 The Headline Agency 45
106 MP Promotions 56
107 Modo Production Ltd 69
108 Nomadic Music 84
109 Reverb Records Ltd 101
110 SIBC 20
111 Marken Time Critical Express 41
112 102.2 Smooth FM 64
113 Chesterfield Arts Centre 89
114 The National Indoor Arena 116
115 Salisbury City Hall 45
116 Minder Music 76
Company ID Company name Number of employees

Initialization code

In the initialization code you should place "number-range" as type of the column filter as shown below:

	
$('#example').dataTable().columnFilter({ sPlaceHolder: "head:after",
                                                             aoColumns: [
                                                                         { type: "number-range" },
                                                                         { type: "text" },
                                                                         { type: "number-range" }
                                                                         ]
                });
			

In ths example fiter row injected in the second row of the THEAD section of the table so you will need to manually place this duplicate row.

Other examples