This demo shows how to filter a column data by using the custom_cell_data delegate function.
var totRowIndex = tf_Tag(tf_Id('demo'),"tr").length; var props = { sort: true, sort_config: { sort_col: [1,false] }, filters_row_index: 1, alternate_rows: true, rows_counter: true, rows_counter_text: "Displayed rows: ", btn_reset: true, btn_reset_text: "Clear", loader: true, loader_html: '' + '', loader_css_class: 'myLoader', status_bar: true, status_bar_target_id: 'lblStatus', col_number_format: [null,null,null,null,'EU','US',null,null,null], col_date_type: [null,null,null,null,null,null,null,'dmy','mdy'], rows_always_visible:[totRowIndex], on_filters_loaded: function(o){ o.SetAlternateRows(); }, custom_cell_data_cols: [0,9], custom_cell_data: function(o,c,i){ if(i==0) { var chk = c.getElementsByTagName('input')[0]; if(!chk || c.parentNode.parentNode.parentNode.nodeName=='TFOOT') return ''; if(chk.checked) return 'yes'; else return 'no'; } else { var slc = c.getElementsByTagName('select')[0]; if(!slc) return 'none'; else return (tf_isIE) ? slc.options[slc.options.selectedIndex].firstChild.data : slc.value; } }, col_operation: { id: ["sum1","sum2"], col: [4,5], operation: ["sum","sum"], write_method: ["innerhtml",'innerhtml'], exclude_row: [totRowIndex], decimal_precision: [2,2], tot_row_index: [totRowIndex] }, on_after_operation: formatTotals, col_0: 'select', col_9: 'select' } var tf = setFilterGrid("demo",props);
Active |
Id | Phone | € | US $ | Url | EU Date | US Date | Contact type |
|
---|---|---|---|---|---|---|---|---|---|
Tot | |||||||||
devo@flexomat.com | 66672 | 941-964-8535 | 2.482,79 |
2,482.79 |
http://gmail.com | 14/12/1988 | 12/14/1988 | |
|
henry@mountdev.net | 35889 | 941-964-9543 | 2.776,09 |
2,776.09 |
http://www.gmail.com | 19/1/1984 | 1/19/1984 | |
|
christian@reno.gov | 60021 | 941-964-5617 | 2.743,41 |
2,743.41 |
http://www.dotnet.ca | 25/3/2000 | 3/25/2000 | |
|
muffins@donuts.com | 17927 | 941-964-9511 | 2.998,18 |
2,998.18 |
http://google.se | 24/1/1993 | 1/24/1993 | |
|
muffins@reno.gov | 76375 | 941-964-2757 | 1.836,09 |
1,836.09 |
http://www.samba.org | 4/4/1988 | 4/4/1988 | |
|
mendez@gmail.com | 45834 | 941-964-2575 | 2.805,46 |
2,805.46 |
http://flexomat.com | 12/12/1985 | 12/12/1985 | |
|
dev@gmail.com | 20022 | 941-964-4967 | 3.296,54 |
3,296.54 |
http://www.flexomat.com | 3/7/2002 | 7/3/2002 | |
|
foo@polyester.se | 55987 | 941-964-745 | 2.953,73 |
2,953.73 |
http://www.donuts.com | 4/8/1987 | 8/4/1987 | |
|
adam@aftonbladet.se | 38867 | 941-964-6302 | 1.949,27 |
1,949.27 |
http://flexomat.com | 27/7/1995 | 7/27/1995 | |
|
devo@donuts.com | 51426 | 941-964-1234 | 1.067,00 |
1,067.00 |
http://www.polyester.se | 5/1/1986 | 1/5/1986 | |
|
henry@samba.org | 40859 | 941-964-4856 | 3.401,19 |
3,401.19 |
http://www.flexomat.com | 7/3/1990 | 3/7/1990 | |
|
found@dotnet.ca | 23986 | 941-964-2686 | 1.393,52 |
1,393.52 |
http://lostnfound.org | 22/7/1993 | 7/22/1993 | |
|
carl@fish.org | 73392 | 941-964-5792 | 3.876,04 |
3,876.04 |
http://www.google.se | 14/7/1984 | 7/14/1984 | |
|
found@mountdev.net | 03519 | 941-964-1599 | 1.176,48 |
1,176.48 |
http://donuts.com | 6/8/2000 | 8/6/2000 | |
|
lost@fish.org | 36628 | 941-964-5985 | 822,23 |
822.23 |
http://www.gmail.com | 14/7/1994 | 7/14/1994 | |
|
mendez@dotnet.ca | 90442 | 941-964-1649 | 1.985,72 |
1,975.72 |
http://reno.gov | 20/10/1997 | 10/20/1997 | |
|
carl@donuts.com | 00412 | 941-964-6432 | 1.834,77 |
1,834.77 |
http://gmail.com | 23/8/1997 | 8/23/1997 | |
|
foo@fish.org | 80653 | 941-964-1022 | 260,26 |
260.26 |
http://samba.org | 24/11/1991 | 11/24/1991 | |
|
found@fish.org | 54635 | 941-964-6439 | 1.442,80 |
1,442.80 |
http://dotnet.ca | 12/7/1987 | 7/12/1987 | |
|
found@flexomat.com | 20953 | 941-964-5544 | 575,42 |
575.42 |
http://gmail.com | 10/6/1988 | 6/10/1988 | |