mirror of
https://github.com/koalyptus/TableFilter.git
synced 2024-06-08 00:42:28 +02:00
Added external filters demo
This commit is contained in:
parent
3c80a855bb
commit
a0b2de403b
|
@ -17,6 +17,13 @@
|
||||||
background-color: #F7F7F7;
|
background-color: #F7F7F7;
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
}
|
}
|
||||||
|
.panel{
|
||||||
|
float: left;
|
||||||
|
background: #F7F7F7 none repeat scroll 0% 0%;
|
||||||
|
width: 250px;
|
||||||
|
margin-right: 2em;
|
||||||
|
padding: 1em;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
|
@ -17,6 +17,13 @@
|
||||||
background-color: #F7F7F7;
|
background-color: #F7F7F7;
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
}
|
}
|
||||||
|
.panel{
|
||||||
|
float: left;
|
||||||
|
background: #F7F7F7 none repeat scroll 0% 0%;
|
||||||
|
width: 250px;
|
||||||
|
margin-right: 2em;
|
||||||
|
padding: 1em;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
|
@ -17,6 +17,13 @@
|
||||||
background-color: #F7F7F7;
|
background-color: #F7F7F7;
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
}
|
}
|
||||||
|
.panel{
|
||||||
|
float: left;
|
||||||
|
background: #F7F7F7 none repeat scroll 0% 0%;
|
||||||
|
width: 250px;
|
||||||
|
margin-right: 2em;
|
||||||
|
padding: 1em;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
13107
examples/external-filters.html
Normal file
13107
examples/external-filters.html
Normal file
File diff suppressed because it is too large
Load diff
|
@ -17,6 +17,13 @@
|
||||||
background-color: #F7F7F7;
|
background-color: #F7F7F7;
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
}
|
}
|
||||||
|
.panel{
|
||||||
|
float: left;
|
||||||
|
background: #F7F7F7 none repeat scroll 0% 0%;
|
||||||
|
width: 250px;
|
||||||
|
margin-right: 2em;
|
||||||
|
padding: 1em;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
|
@ -17,6 +17,13 @@
|
||||||
background-color: #F7F7F7;
|
background-color: #F7F7F7;
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
}
|
}
|
||||||
|
.panel{
|
||||||
|
float: left;
|
||||||
|
background: #F7F7F7 none repeat scroll 0% 0%;
|
||||||
|
width: 250px;
|
||||||
|
margin-right: 2em;
|
||||||
|
padding: 1em;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
|
@ -17,6 +17,13 @@
|
||||||
background-color: #F7F7F7;
|
background-color: #F7F7F7;
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
}
|
}
|
||||||
|
.panel{
|
||||||
|
float: left;
|
||||||
|
background: #F7F7F7 none repeat scroll 0% 0%;
|
||||||
|
width: 250px;
|
||||||
|
margin-right: 2em;
|
||||||
|
padding: 1em;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
|
@ -17,6 +17,13 @@
|
||||||
background-color: #F7F7F7;
|
background-color: #F7F7F7;
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
}
|
}
|
||||||
|
.panel{
|
||||||
|
float: left;
|
||||||
|
background: #F7F7F7 none repeat scroll 0% 0%;
|
||||||
|
width: 250px;
|
||||||
|
margin-right: 2em;
|
||||||
|
padding: 1em;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
13047
examples/old/demo.html
Normal file
13047
examples/old/demo.html
Normal file
File diff suppressed because it is too large
Load diff
|
@ -2,7 +2,7 @@
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<title>HTML Table Filter Generator</title>
|
<title>HTML Table Filter Generator</title>
|
||||||
<link rel="stylesheet" type="text/css" href="../dist/tablefilter/style/tablefilter.css">
|
<link rel="stylesheet" type="text/css" href="../../dist/tablefilter/style/tablefilter.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="test"></div>
|
<div id="test"></div>
|
||||||
|
@ -86,7 +86,7 @@
|
||||||
<button onclick="tf.init();">Reset</button>
|
<button onclick="tf.init();">Reset</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script type="text/javascript" src="../dist/tablefilter/tablefilter.js"></script>
|
<script type="text/javascript" src="../../dist/tablefilter/tablefilter.js"></script>
|
||||||
<script>
|
<script>
|
||||||
var table = document.getElementById('demo');
|
var table = document.getElementById('demo');
|
||||||
var totRowIndex = table.getElementsByTagName("tr").length;
|
var totRowIndex = table.getElementsByTagName("tr").length;
|
||||||
|
@ -95,7 +95,7 @@
|
||||||
col_0: 'select',
|
col_0: 'select',
|
||||||
col_2: 'checklist',
|
col_2: 'checklist',
|
||||||
col_3: 'select',
|
col_3: 'select',
|
||||||
base_path: '../dist/tablefilter/',
|
base_path: '../../dist/tablefilter/',
|
||||||
// fill_slc_on_demand: true,
|
// fill_slc_on_demand: true,
|
||||||
rows_counter: true,
|
rows_counter: true,
|
||||||
// enable_default_theme: true,
|
// enable_default_theme: true,
|
||||||
|
@ -143,9 +143,9 @@
|
||||||
types: ['string', 'string', 'number', 'number', 'number']
|
types: ['string', 'string', 'number', 'number', 'number']
|
||||||
},{
|
},{
|
||||||
name: 'advancedGrid',
|
name: 'advancedGrid',
|
||||||
vendor_path: '../libs/ezEditTable/',
|
// vendor_path: '../../libs/ezEditTable/',
|
||||||
// filename: 'ezEditTable_min.js',
|
filename: 'ezEditTable_min.js',
|
||||||
// vendor_path: 'http://edittable.free.fr/ezEditTable/',
|
vendor_path: 'http://edittable.free.fr/ezEditTable/',
|
||||||
selectable: true,
|
selectable: true,
|
||||||
editable: true,
|
editable: true,
|
||||||
default_selection: 'both',
|
default_selection: 'both',
|
|
@ -17,6 +17,13 @@
|
||||||
background-color: #F7F7F7;
|
background-color: #F7F7F7;
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
}
|
}
|
||||||
|
.panel{
|
||||||
|
float: left;
|
||||||
|
background: #F7F7F7 none repeat scroll 0% 0%;
|
||||||
|
width: 250px;
|
||||||
|
margin-right: 2em;
|
||||||
|
padding: 1em;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -13,4 +13,11 @@
|
||||||
background-color: #F7F7F7;
|
background-color: #F7F7F7;
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
}
|
}
|
||||||
|
.panel{
|
||||||
|
float: left;
|
||||||
|
background: #F7F7F7 none repeat scroll 0% 0%;
|
||||||
|
width: 250px;
|
||||||
|
margin-right: 2em;
|
||||||
|
padding: 1em;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
119
static/templates/external-filters.html
Normal file
119
static/templates/external-filters.html
Normal file
|
@ -0,0 +1,119 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<title>{NAME} v{VERSION} - External Filters Demo</title>
|
||||||
|
<!-- @import partials/style.html -->
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>{NAME} v{VERSION}</h1>
|
||||||
|
<h2>External filters demo</h2>
|
||||||
|
<p>
|
||||||
|
This demo shows how generate the column filters in an external container.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<div id="extGrid" class="panel">
|
||||||
|
<label>Choose Country:</label><br>
|
||||||
|
<span id="slcCountry"></span><br>
|
||||||
|
<span>Keep Ctrl/Cmd key pressed for multiple selections</span><br><br>
|
||||||
|
<label>Choose Country code:</label><br>
|
||||||
|
<span id="slcCode"></span><br><br>
|
||||||
|
<label>Choose year:</label><br>
|
||||||
|
<span id="slcYear"></span><br><br>
|
||||||
|
<label for="inpPop">POP:</label><br>
|
||||||
|
<span id="inpPop"></span><br><br>
|
||||||
|
|
||||||
|
<form id="frmRadioInps" name="frmRadioInps">
|
||||||
|
<label for="rdoXRat">XRAT:</label><br>
|
||||||
|
<input type="checkbox" id="rdoXRat" name="rdoXRat" value="!NA"
|
||||||
|
onclick="
|
||||||
|
if(this.checked){
|
||||||
|
tf.setFilterValue(4, this.value);
|
||||||
|
} else tf.setFilterValue(4, '');
|
||||||
|
tf.filter();" >Not NA
|
||||||
|
|
||||||
|
<br><br>
|
||||||
|
|
||||||
|
<label for="chkCI">CI:</label><br>
|
||||||
|
<input type="radio" id="chkCI" name="chkCI" value=">0 && <=10"
|
||||||
|
onclick="
|
||||||
|
if(this.checked){
|
||||||
|
tf.setFilterValue(8, this.value);
|
||||||
|
tf.filter();
|
||||||
|
}" > 0 - 10
|
||||||
|
<input type="radio" id="chkCI" name="chkCI" value=">10 && <=20"
|
||||||
|
onclick="
|
||||||
|
if(this.checked){
|
||||||
|
tf.setFilterValue(8, this.value);
|
||||||
|
tf.filter();
|
||||||
|
}" > 10 - 20
|
||||||
|
<input type="radio" id="chkCI" name="chkCI" value=">20 && <=30"
|
||||||
|
onclick="
|
||||||
|
if(this.checked){
|
||||||
|
tf.setFilterValue(8, this.value);
|
||||||
|
tf.filter();
|
||||||
|
}" > 20 - 30
|
||||||
|
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
<div style="float:left;">
|
||||||
|
<input id="btnFlt" value="Filter" type="button"
|
||||||
|
onclick="tf.filter();" >
|
||||||
|
<input id="btnClr" value="Clear" type="button"
|
||||||
|
onclick="tf.clearFilters();
|
||||||
|
//clears radio btns
|
||||||
|
for( var o=frmRadioInps.elements, p=o.length - 1; p > -1; p--) {
|
||||||
|
if ( o[p].type ){
|
||||||
|
o[p].checked = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
" >
|
||||||
|
</div>
|
||||||
|
<div id="statusDiv"></div>
|
||||||
|
<div style="clear:both;"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- @import partials/pre.html -->
|
||||||
|
<!-- @import partials/countries-table.html -->
|
||||||
|
|
||||||
|
<!-- @import partials/tablefilter-script.html -->
|
||||||
|
<script data-config>
|
||||||
|
var tfConfig = {
|
||||||
|
base_path: '../dist/tablefilter/',
|
||||||
|
alternate_rows: true,
|
||||||
|
rows_counter: true,
|
||||||
|
rows_counter_text: "Displayed rows: ",
|
||||||
|
loader: true,
|
||||||
|
status: true,
|
||||||
|
status_bar: true,
|
||||||
|
status_bar_target_id: 'statusDiv',
|
||||||
|
col_number_format: [
|
||||||
|
null, null, 'US',
|
||||||
|
'US', 'US', 'US',
|
||||||
|
'US', 'US', 'US'
|
||||||
|
],
|
||||||
|
display_all_text: " [ Show all ] ",
|
||||||
|
col_0: "multiple",
|
||||||
|
col_1: "select",
|
||||||
|
col_2: "checklist",
|
||||||
|
col_4: "none",
|
||||||
|
col_8: "none",
|
||||||
|
external_flt_grid: true,
|
||||||
|
external_flt_grid_ids: [
|
||||||
|
'slcCountry',
|
||||||
|
'slcCode',
|
||||||
|
'slcYear',
|
||||||
|
'inpPop'
|
||||||
|
],
|
||||||
|
|
||||||
|
/* Sorting feature */
|
||||||
|
extensions: [{ name: 'sort' }]
|
||||||
|
};
|
||||||
|
|
||||||
|
var tf = new TableFilter('demo', tfConfig);
|
||||||
|
tf.init();
|
||||||
|
</script>
|
||||||
|
<!-- @import partials/pre-inline-script.html -->
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -14,7 +14,7 @@
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<!-- @import partials/pre.html -->
|
<!-- @import partials/pre.html -->
|
||||||
<!-- @import partials/books-table-images.html -->
|
<!-- @import partials/books-table-with-images.html -->
|
||||||
|
|
||||||
<!-- @import partials/tablefilter-script.html -->
|
<!-- @import partials/tablefilter-script.html -->
|
||||||
<script data-config>
|
<script data-config>
|
||||||
|
|
Loading…
Reference in a new issue