Commit a1f0799c41894491a3ba49ba686dd38a4f743c2a

Authored by isisadmin
1 parent 938d1928

datalet global refactoring

Showing 498 changed files with 529 additions and 240480 deletions

Too many changes.

To preserve performance only 100 of 498 files are displayed.

datalets/barchart-datalet/barchart-datalet.html
... ... @@ -22,7 +22,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 22 THE SOFTWARE.
23 23 -->
24 24  
25   -<link rel="import" href="../../bower_components/polymer/polymer.html">
26 25 <link rel="import" href="../highcharts-datalet/highcharts-datalet.html">
27 26  
28 27 <!--
... ... @@ -32,14 +31,14 @@ THE SOFTWARE.
32 31 Example:
33 32  
34 33 <barchart-datalet data-url="http://ckan.routetopa.eu/api/action/datastore_search?resource_id=73e02092-85a1-434e-85fe-0c9a43aa9a52&amp;limit=10000"
35   - query="$['result']['records'][*]['Lat']###$['result']['records'][*]['Lng']">
  34 + fields='["result,records,Lat","result,records,Lng"]'></barchart-datalet>
36 35  
37 36  
38 37 -->
39 38  
40 39 <dom-module name="barchart-datalet">
41 40 <template>
42   - <highcharts-datalet id="charts" data-url="{{dataUrl}}" query="{{query}}" fields-order="{{fieldsOrder}}"></highcharts-datalet>
  41 + <highcharts-datalet id="charts" data-url="{{dataUrl}}" fields="{{fields}}"></highcharts-datalet>
43 42 </template>
44 43 <script>
45 44 var BarchartBehavior = {
... ...
datalets/base-ajax-json-jsonpath-datalet/base-ajax-json-jsonpath-datalet.html 0 → 100644
  1 +<!--
  2 +The MIT License (MIT)
  3 +
  4 +Copyright (c) 2015 ROUTE-TO-PA CONSORTIUM
  5 +
  6 +Permission is hereby granted, free of charge, to any person obtaining a copy
  7 +of this software and associated documentation files (the "Software"), to deal
  8 +in the Software without restriction, including without limitation the rights
  9 +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  10 +copies of the Software, and to permit persons to whom the Software is
  11 +furnished to do so, subject to the following conditions:
  12 +
  13 +The above copyright notice and this permission notice shall be included in
  14 +all copies or substantial portions of the Software.
  15 +
  16 +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  17 +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  18 +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  19 +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  20 +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  21 +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  22 +THE SOFTWARE.
  23 +-->
  24 +
  25 +<link rel="import" href="../base-datalet/base-datalet.html">
  26 +
  27 +<!--
  28 +@group ROUTETOPA Base Web Component
  29 +
  30 +The `base-datalet` is a base-datalet web component that has built up by using Polymer.
  31 +Pass to this component a data url(CKAN api uri) and a string with one or multiple query in JsonPath format(separated by spaces) and it'll build an object
  32 +you can use to set up the structures for presentation.
  33 +
  34 +### Code
  35 +
  36 +Example
  37 +
  38 + <base-datalet
  39 + dataUrl="http://demo.ckan.org/api/action/datastore_search?resource_id=8324a4c9-66d6-47bf-a898-94237cc39b9f&amp;limit=50"
  40 + query="$.result.records..Supplier $.result.records..Amount">
  41 + </base-datalet>
  42 +
  43 +### HTML
  44 +
  45 + <base-datalet
  46 + dataUrl="http://demo.ckan.org/api/action/datastore_search?resource_id=8324a4c9-66d6-47bf-a898-94237cc39b9f&amp;limit=50"
  47 + query="$.result.records..Supplier $.result.records..Amount">
  48 + </base-datalet>
  49 +
  50 +@class base-datalet
  51 +-->
  52 +
  53 +<dom-module id="base-ajax-json-jsonpath-datalet">
  54 + <template>
  55 + <base-datalet data-url="{{dataUrl}}" fields="{{fields}}"></base-datalet>
  56 + </template>
  57 +
  58 + <script src="static/js/vendor/jsonpath-0.8.5.js"></script>
  59 + <script src="static/js/AjaxJsonJsonPathBehavior.js"></script>
  60 +
  61 + <script>
  62 + BaseDatalet = Polymer({
  63 + is: 'base-ajax-json-jsonpath-datalet'
  64 + });
  65 + </script>
  66 +</dom-module>
0 67 \ No newline at end of file
... ...
datalets/base-ajax-json-jsonpath-datalet/static/js/AjaxJsonJsonPathBehavior.js 0 → 100644
  1 +/*
  2 + The MIT License (MIT)
  3 +
  4 + Copyright (c) 2015 Dipartimento di Informatica - Università di Salerno, Italy
  5 +
  6 + Permission is hereby granted, free of charge, to any person obtaining a copy
  7 + of this software and associated documentation files (the "Software"), to deal
  8 + in the Software without restriction, including without limitation the rights
  9 + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  10 + copies of the Software, and to permit persons to whom the Software is
  11 + furnished to do so, subject to the following conditions:
  12 +
  13 + The above copyright notice and this permission notice shall be included in
  14 + all copies or substantial portions of the Software.
  15 +
  16 + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  17 + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  18 + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  19 + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  20 + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  21 + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  22 + THE SOFTWARE.
  23 + */
  24 +
  25 +var AjaxJsonJsonPathBehavior = {
  26 +
  27 + properties: {
  28 +
  29 + /**
  30 + * It contains the json data from async xhr call returned from core-ajax core component
  31 + *
  32 + * @attribute json_results
  33 + * @type object
  34 + * @default 'null'.
  35 + */
  36 + json_results: {
  37 + type: Object,
  38 + value: {}
  39 + }
  40 + },
  41 +
  42 + requestData: function(){
  43 +
  44 + var comp = this;
  45 +
  46 + $.ajax({
  47 + url: this._component.dataUrl,
  48 + dataType: "json",
  49 + success: function(e){
  50 + comp.handleResponse(e);
  51 + }
  52 + });
  53 + },
  54 +
  55 + /**
  56 + * Called when core-ajax component receive the json data from called url. It is responsible to
  57 + * extract data from response, coded in json, and refine it by using JsonPath queries in the query attribute.
  58 + * After this phase it parses the resulting object to populate the structure(keys,values) to fill the final table by using
  59 + * angularJs syntax.
  60 + *
  61 + * @method handleResponse
  62 + */
  63 + handleResponse: function(e) {
  64 + this.properties.json_results.value = e;
  65 + this.createDataObject();
  66 + this.runWorkcycle();
  67 + },
  68 +
  69 + createDataObject : function(){
  70 +
  71 + this.data = [];
  72 + this._component.fields = JSON.parse(this._component.fields);
  73 +
  74 + for(var i=0;i < this._component.fields.length; i++){
  75 + var query = "$";
  76 + var query_elements = this._component.fields[i].split(',');
  77 + for(var j=0; j < query_elements.length - 1;j++){
  78 + query += "['" + query_elements[j] + "']";
  79 + }
  80 + query += "[*]" + "['" + query_elements[query_elements.length - 1] + "']";
  81 + this.data.push({name : query_elements[query_elements.length - 1], data : jsonPath(this.properties.json_results.value, query)});
  82 + }
  83 + }
  84 +
  85 +};
0 86 \ No newline at end of file
... ...
datalets/base-ajax-json-jsonpath-datalet/static/js/vendor/jsonpath-0.8.5.js 0 → 100644
  1 +/* JSONPath 0.8.5 - XPath for JSON
  2 + *
  3 + * Copyright (c) 2007 Stefan Goessner (goessner.net)
  4 + * Licensed under the MIT (MIT-LICENSE.txt) licence.
  5 + *
  6 + * Proposal of Chris Zyp goes into version 0.9.x
  7 + * Issue 7 resolved
  8 + */
  9 +function jsonPath(obj, expr, arg) {
  10 + var P = {
  11 + resultType: arg && arg.resultType || "VALUE",
  12 + result: [],
  13 + normalize: function(expr) {
  14 + var subx = [];
  15 + return expr.replace(/[\['](\??\(.*?\))[\]']|\['(.*?)'\]/g, function($0,$1,$2){return "[#"+(subx.push($1||$2)-1)+"]";}) /* http://code.google.com/p/jsonpath/issues/detail?id=4 */
  16 + .replace(/'?\.'?|\['?/g, ";")
  17 + .replace(/;;;|;;/g, ";..;")
  18 + .replace(/;$|'?\]|'$/g, "")
  19 + .replace(/#([0-9]+)/g, function($0,$1){return subx[$1];});
  20 + },
  21 + asPath: function(path) {
  22 + var x = path.split(";"), p = "$";
  23 + for (var i=1,n=x.length; i<n; i++)
  24 + p += /^[0-9*]+$/.test(x[i]) ? ("["+x[i]+"]") : ("['"+x[i]+"']");
  25 + return p;
  26 + },
  27 + store: function(p, v) {
  28 + if (p) P.result[P.result.length] = P.resultType == "PATH" ? P.asPath(p) : v;
  29 + return !!p;
  30 + },
  31 + trace: function(expr, val, path) {
  32 + if (expr !== "") {
  33 + var x = expr.split(";"), loc = x.shift();
  34 + x = x.join(";");
  35 + if (val && val.hasOwnProperty(loc))
  36 + P.trace(x, val[loc], path + ";" + loc);
  37 + else if (loc === "*")
  38 + P.walk(loc, x, val, path, function(m,l,x,v,p) { P.trace(m+";"+x,v,p); });
  39 + else if (loc === "..") {
  40 + P.trace(x, val, path);
  41 + P.walk(loc, x, val, path, function(m,l,x,v,p) { typeof v[m] === "object" && P.trace("..;"+x,v[m],p+";"+m); });
  42 + }
  43 + else if (/^\(.*?\)$/.test(loc)) // [(expr)]
  44 + P.trace(P.eval(loc, val, path.substr(path.lastIndexOf(";")+1))+";"+x, val, path);
  45 + else if (/^\?\(.*?\)$/.test(loc)) // [?(expr)]
  46 + P.walk(loc, x, val, path, function(m,l,x,v,p) { if (P.eval(l.replace(/^\?\((.*?)\)$/,"$1"), v instanceof Array ? v[m] : v, m)) P.trace(m+";"+x,v,p); }); // issue 5 resolved
  47 + else if (/^(-?[0-9]*):(-?[0-9]*):?([0-9]*)$/.test(loc)) // [start:end:step] phyton slice syntax
  48 + P.slice(loc, x, val, path);
  49 + else if (/,/.test(loc)) { // [name1,name2,...]
  50 + for (var s=loc.split(/'?,'?/),i=0,n=s.length; i<n; i++)
  51 + P.trace(s[i]+";"+x, val, path);
  52 + }
  53 + }
  54 + else
  55 + P.store(path, val);
  56 + },
  57 + walk: function(loc, expr, val, path, f) {
  58 + if (val instanceof Array) {
  59 + for (var i=0,n=val.length; i<n; i++)
  60 + if (i in val)
  61 + f(i,loc,expr,val,path);
  62 + }
  63 + else if (typeof val === "object") {
  64 + for (var m in val)
  65 + if (val.hasOwnProperty(m))
  66 + f(m,loc,expr,val,path);
  67 + }
  68 + },
  69 + slice: function(loc, expr, val, path) {
  70 + if (val instanceof Array) {
  71 + var len=val.length, start=0, end=len, step=1;
  72 + loc.replace(/^(-?[0-9]*):(-?[0-9]*):?(-?[0-9]*)$/g, function($0,$1,$2,$3){start=parseInt($1||start);end=parseInt($2||end);step=parseInt($3||step);});
  73 + start = (start < 0) ? Math.max(0,start+len) : Math.min(len,start);
  74 + end = (end < 0) ? Math.max(0,end+len) : Math.min(len,end);
  75 + for (var i=start; i<end; i+=step)
  76 + P.trace(i+";"+expr, val, path);
  77 + }
  78 + },
  79 + eval: function(x, _v, _vname) {
  80 + try { return $ && _v && eval(x.replace(/(^|[^\\])@/g, "$1_v").replace(/\\@/g, "@")); } // issue 7 : resolved ..
  81 + catch(e) { throw new SyntaxError("jsonPath: " + e.message + ": " + x.replace(/(^|[^\\])@/g, "$1_v").replace(/\\@/g, "@")); } // issue 7 : resolved ..
  82 + }
  83 + };
  84 +
  85 + var $ = obj;
  86 + if (expr && obj && (P.resultType == "VALUE" || P.resultType == "PATH")) {
  87 + P.trace(P.normalize(expr).replace(/^\$;?/,""), obj, "$"); // issue 6 resolved
  88 + return P.result.length ? P.result : false;
  89 + }
  90 +}
... ...
datalets/base-datalet/base-datalet.html
1 1 <!--
  2 +The MIT License (MIT)
  3 +
  4 +Copyright (c) 2015 ROUTE-TO-PA CONSORTIUM
  5 +
  6 +Permission is hereby granted, free of charge, to any person obtaining a copy
  7 +of this software and associated documentation files (the "Software"), to deal
  8 +in the Software without restriction, including without limitation the rights
  9 +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  10 +copies of the Software, and to permit persons to whom the Software is
  11 +furnished to do so, subject to the following conditions:
  12 +
  13 +The above copyright notice and this permission notice shall be included in
  14 +all copies or substantial portions of the Software.
  15 +
  16 +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  17 +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  18 +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  19 +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  20 +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  21 +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  22 +THE SOFTWARE.
  23 +-->
  24 +
  25 +<link rel="import" href="../../bower_components/polymer/polymer.html">
  26 +
  27 +<!--
2 28 @group ROUTETOPA Base Web Component
3 29  
4 30 The `base-datalet` is a base-datalet web component that has built up by using Polymer.
... ... @@ -23,7 +49,6 @@ Example
23 49  
24 50 @class base-datalet
25 51 -->
26   -<link rel="import" href="../../bower_components/polymer/polymer.html">
27 52  
28 53 <dom-module id="base-datalet">
29 54 <template>
... ... @@ -45,10 +70,7 @@ Example
45 70 <div id="footer">Powered by Route-to-PA&nbsp&nbsp<a href="http://routetopa.eu/"><img src="static/images/rtpalogo.png" id="rtpalogo"></a></div><br>
46 71 </template>
47 72  
48   - <!--<script src="../shared_js/jquery-1.11.2.min.js"></script>-->
49   - <script src="../shared_js/jsonpath-0.8.5.js"></script>
50   - <script src="../shared_js/behaviors/BaseDataletBehaviors.js"></script>
51   - <script src="../shared_js/behaviors/AjaxJsonDataRequestBehavior.js"></script>
  73 + <script src="static/js/BaseDataletBehaviors.js"></script>
52 74  
53 75 <script>
54 76 BaseDatalet = Polymer({
... ...
datalets/base-datalet/static/js/BaseDataletBehaviors.js 0 → 100644
  1 +/*
  2 + The MIT License (MIT)
  3 +
  4 + Copyright (c) 2015 ROUTE-TO-PA CONSORTIUM
  5 +
  6 + Permission is hereby granted, free of charge, to any person obtaining a copy
  7 + of this software and associated documentation files (the "Software"), to deal
  8 + in the Software without restriction, including without limitation the rights
  9 + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  10 + copies of the Software, and to permit persons to whom the Software is
  11 + furnished to do so, subject to the following conditions:
  12 +
  13 + The above copyright notice and this permission notice shall be included in
  14 + all copies or substantial portions of the Software.
  15 +
  16 + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  17 + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  18 + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  19 + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  20 + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  21 + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  22 + THE SOFTWARE.
  23 +*/
  24 +
  25 +var BaseDataletBehavior ={
  26 +
  27 + properties: {
  28 +
  29 + /**
  30 + * It represent the data url from CKAN api
  31 + *
  32 + * @attribute dataUrl
  33 + * @type string
  34 + * @default 'null'
  35 + */
  36 + dataUrl: {
  37 + type: String,
  38 + value: ""
  39 + },
  40 +
  41 + /**
  42 + * It represents one or multiple fields selected by user
  43 + *
  44 + * @attribute fields
  45 + * @type Array
  46 + * @default empty
  47 + */
  48 + fields: {
  49 + type: String,
  50 + value: ""
  51 + },
  52 +
  53 + /**
  54 + * The selected and transformed data you can use in presentation phase
  55 + *
  56 + * @attribute data
  57 + * @type Array
  58 + * @default empty
  59 + */
  60 + data: {
  61 + type: Array,
  62 + value: []
  63 + }
  64 +
  65 + },
  66 +
  67 + factoryImpl: function(data_url, fields) {
  68 + this.data_url = data_url;
  69 + this.fields = fields;
  70 + }
  71 +
  72 +};
  73 +
  74 +var WorkcycleBehavior = {
  75 +
  76 + _component: null,
  77 + /**
  78 + * Request data from source(e.g. CKAN by api) using some kind of technology(e.g. Ajax)
  79 + *
  80 + * @method requestData
  81 + */
  82 + requestData: function(){
  83 +
  84 + },
  85 +
  86 + /**
  87 + * Select the fields from data(typically json) previously retrieved by ajax request. The selection could be done by jsonPath but
  88 + * it depends on the representation data format(CKAN apies return a json representation of the dataset).
  89 + *
  90 + * @method selectData
  91 + */
  92 + selectData: function(){
  93 + },
  94 +
  95 + /**
  96 + * Filter data previously selected. An example of filterting could be an expression such "fields > 30" or "fields = 'AAA'"
  97 + * If you are using jsonPath to select the datas you can apply an expression directly in the jsonPath query string.
  98 + *
  99 + * @method filterData
  100 + */
  101 + filterData: function(){
  102 + },
  103 +
  104 + /**
  105 + * Transform the selected data in order to build the structure that the presentation phase needs.
  106 + *
  107 + * @method transformData
  108 + */
  109 + transformData: function(){
  110 + },
  111 +
  112 + /**
  113 + * Called when iron-ajax component receive the json data from called url. It is responsible to
  114 + * extract data from response, coded in json, and refine it by using JsonPath queries in the query attribute.
  115 + * After this phase it parses the resulting object to populate the structure(keys,values) to fill the final table by using
  116 + * angularJs syntax.
  117 + *
  118 + * @method handleResponse
  119 + */
  120 + runWorkcycle: function() {
  121 + this.selectData();
  122 + this.filterData();
  123 + this.transformData();
  124 + },
  125 +
  126 + init: function(component){
  127 + this._component = component;
  128 + this.requestData();
  129 + }
  130 +
  131 +};
0 132 \ No newline at end of file
... ...
datalets/column3Dchart-datalet/column3Dchart-datalet.html
... ... @@ -23,7 +23,6 @@ THE SOFTWARE.
23 23 -->
24 24  
25 25  
26   -<link rel="import" href="../../bower_components/polymer/polymer.html">
27 26 <link rel="import" href="../highcharts-datalet/highcharts-datalet.html">
28 27 <script src="http://code.highcharts.com/highcharts-3d.js"></script>
29 28  
... ... @@ -48,7 +47,7 @@ Example:
48 47 <tr><td>Alpha Angle</td><td><input id="R0" type="range" min="0" max="45" value="15"/> <span id="R0-value" class="value"></span></td></tr>
49 48 <tr><td>Beta Angle</td><td><input id="R1" type="range" min="0" max="45" value="15"/> <span id="R1-value" class="value"></span></td></tr>
50 49 </table>
51   - <highcharts-datalet id="charts" data-url="{{dataUrl}}" query="{{query}}" fields-order="{{fieldsOrder}}"></highcharts-datalet>
  50 + <highcharts-datalet id="charts" data-url="{{dataUrl}}" fields="{{fields}}"></highcharts-datalet>
52 51 </template>
53 52  
54 53 <script>
... ... @@ -125,9 +124,7 @@ Example:
125 124 * @method ready
126 125 */
127 126 ready: function(){
128   - var column3DchartComponentBehavior = $.extend({}, HighchartsComponentBehavior, column3DchartBehavior);
129   - column3DchartComponentBehavior.properties = $.extend({}, HighchartsComponentBehavior.properties, column3DchartBehavior.properties);
130   -
  127 + var column3DchartComponentBehavior = $.extend(true, {}, HighchartsComponentBehavior, column3DchartBehavior);
131 128 column3DchartComponentBehavior.init(this);
132 129 }
133 130 });
... ...
datalets/columnchart-datalet/columnchart-datalet.html
... ... @@ -22,7 +22,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 22 THE SOFTWARE.
23 23 -->
24 24  
25   -<link rel="import" href="../../bower_components/polymer/polymer.html">
26 25 <link rel="import" href="../highcharts-datalet/highcharts-datalet.html">
27 26  
28 27 <!--
... ... @@ -39,7 +38,7 @@ Example:
39 38  
40 39 <dom-module id="columnchart-datalet">
41 40 <template>
42   - <highcharts-datalet id="charts" data-url="{{dataUrl}}" query="{{query}}" fields-order="{{fieldsOrder}}"></highcharts-datalet>
  41 + <highcharts-datalet id="charts" data-url="{{dataUrl}}" fields="{{fields}}"></highcharts-datalet>
43 42 </template>
44 43 <script>
45 44 var ColumnchartBehavior = {
... ...
datalets/datatable-datalet/datatable-datalet.html
... ... @@ -16,64 +16,44 @@ Example
16 16  
17 17 @class datatables-datalet
18 18 -->
19   -<link rel="import" href="../../bower_components/polymer/polymer.html">
20   -<link rel="import" href="../base-datalet/base-datalet.html">
  19 +<link rel="import" href="../base-ajax-json-jsonpath-datalet/base-ajax-json-jsonpath-datalet.html">
21 20  
22 21 <dom-module id="datatable-datalet">
23 22 <template>
24   - <!--<link rel="stylesheet" href="../shared_js/bootstrap-3.3.4-dist/css/bootstrap.css">
25   - <link rel="stylesheet" href="js/DataTables-master/media/css/dataTables.bootstrap.css">-->
26   - <link rel="stylesheet" href="js/DataTables-1.10.5/media/css/jquery.dataTables.min.css">
  23 + <link rel="stylesheet" href="js/DataTables-master/media/css/jquery.dataTables.min.css">
27 24  
28 25 <table id="datatable" class="table table-striped table-bordered" cellspacing="0" style="height: auto; width: auto;">
29 26 </table>
30   - <base-datalet data-url="{{dataUrl}}" query="{{query}}"></base-datalet>
  27 + <base-ajax-json-jsonpath-datalet data-url="{{dataUrl}}" fields="{{fields}}"></base-ajax-json-jsonpath-datalet>
31 28 </template>
32 29  
33 30 <script src="js/DataTables-master/media/js/jquery.dataTables.js"></script>
34   - <!--<script src="js/DataTables-master/media/js/dataTables.bootstrap.js"></script>-->
35 31  
36 32 <script>
37 33 var DatatableBehavior = {
38   - tempData : null,
39   - selectData: function(e){
40   - var queries = this._component.query.split("###");
41 34  
42   - for (i = 0; i < queries.length; i++) {
43   - var propName = this.getPropertyName(queries[i]);
44   -
45   - this.tempData = jsonPath(this.properties.json_results.value, queries[i]);
46   - if(!this.tempData || this.tempData == undefined) return;
47   - for (j = 0; j < this.tempData.length; j++) {
48   - if (i == 0) this.properties.data.value[j] = {};
49   - currObj = {};
50   - currObj[propName] = this.tempData[j];
51   - jQuery.extend(this.properties.data.value[j], currObj);
52   - }
53   - }
54   - },
55 35 transformData: function(){
56   - if(!this.tempData || this.tempData == undefined) return;
  36 + if(!this.data || this.data == undefined) return;
57 37 html = "";
58 38 html += '<thead>'+
59 39 '<tr>';
60   - for(value in this.properties.data.value[0]){
61   - html += '<th>' + value + '</th>';
  40 + for(var x = 0; x<this.data.length; x++){
  41 + html += '<th>' + this.data[x].name + '</th>';
62 42 }
63 43 html += '</tr>' +
64 44 '</thead>' +
65 45 '<tfoot>' +
66 46 '<tr>';
67   - for(value in this.properties.data.value[0]){
68   - html += '<th>' + value + '</th>';
  47 + for(var x = 0; x<this.data.length; x++){
  48 + html += '<th>' + this.data[x].name + '</th>';
69 49 }
70 50 html += '</tr>' +
71 51 '</tfoot>' +
72 52 '<tbody>';
73   - for(key in this.properties.data.value){
  53 + for(var i = 0; i<this.data[0].data.length; i++){
74 54 html += '<tr>';
75   - for(value in this.properties.data.value[0]) {
76   - html += '<td>' + this.properties.data.value[key][value] + '</td>';
  55 + for(var x = 0; x<this.data.length; x++){
  56 + html += '<td>' + this.data[x].data[i] + '</td>';
77 57 }
78 58 html += '</tr>';
79 59 }
... ... @@ -87,7 +67,7 @@ Example
87 67 Polymer({
88 68 is : 'datatable-datalet' ,
89 69 ready: function(){
90   - var DatatableComponentBehavior = $.extend(true, {}, BaseDataletBehavior, WorkcycleBehavior,AjaxJsonDataRequestBehavior, DatatableBehavior);
  70 + var DatatableComponentBehavior = $.extend(true, {}, BaseDataletBehavior, WorkcycleBehavior, AjaxJsonJsonPathBehavior, DatatableBehavior);
91 71 DatatableComponentBehavior.init(this);
92 72 }
93 73  
... ...
datalets/datatable-datalet/js/DataTables-1.10.5/Contributing.md deleted
1   -# Contributing
2   -
3   -If you are thinking of contributing code to DataTables, first of all, thank you! All fixes, patches and enhancements to DataTables are very warmly welcomed. In order to keep thing manageable, there are a number of guidelines that should be followed in order to ensure that your modification is included in DataTables as quickly as possible:
4   -
5   -1. Make contributions in the DataTables/DataTablesSrc repo. Changes to the built files in the built repo (DataTables/DataTables) will not be accepted since they would be overwritten by the next build!
6   -
7   -2. Follow the style of the code in the existing files. DataTables doesn't have a coding standards document, but simple common sense of following the same style as in the existing files is ideal. For example use tabs not spaces (as you will see all source files use tabs).
8   -
9   -3. Link to a test page showing the bug you are fixing or the feature you are adding. This allows to me to quickly identify what is being changed and why. Don't worry about being verbose in pull requests - its much better to know exactly what is changing and why!
datalets/datatable-datalet/js/DataTables-1.10.5/Readme.md deleted
1   -# DataTables plug-in for jQuery
2   -
3   -DataTables is a table enhancing plug-in for the [jQuery](//jquery.com) Javascript library, adding sorting, paging and filtering abilities to plain HTML tables with minimal effort. The stated goal of DataTables is:
4   -
5   -> To enhance the accessibility of data in HTML tables.
6   -
7   -To meet this goal, DataTables is developed with two distinct groups of users in mind:
8   -
9   -* You the developers using DataTables. For developers DataTables provides a wide array of options for how data should be obtained, displayed and acted upon, along with an extensive API for accessing and manipulating the table.
10   -
11   -* End users. For those using the interface DataTables presents, actions to get the most from the information contained in tables, such as sorting and filtering, along with paging and scrolling of the data in table, are easy to use, intuitive and fast.
12   -
13   -
14   -## Installation
15   -
16   -In most cases, to use DataTables all you need to do is include jQuery, the DataTables Javascript and DataTables CSS files in your HTML page. See the [DataTables manual](http://datatables.net/manual/installation#Including-Javascript-/-CSS) for details on how to do this using the latest version of DataTables.
17   -
18   -
19   -## Usage
20   -
21   -In its simplest case, DataTables can be initialised with a single line of Javascript:
22   -
23   -```js
24   -$('table').dataTable();
25   -```
26   -
27   -where the jQuery selector is used to obtain a reference to the table you want to enhance with DataTables. Optional configuration parameters can be passed in to DataTables to have it perform certain actions by using a configuration object as the parameter passed in to the DataTables constructor. For example:
28   -
29   -```js
30   -$('table').dataTable( {
31   - paginate: false,
32   - scrollY: 300
33   -} );
34   -```
35   -
36   -will disable paging and enable scrolling.
37   -
38   -A full list of the options available for DataTables are available in the [documentation](//datatables.net).
39   -
40   -
41   -## Documentation
42   -
43   -Full documentation of the DataTables options, API and pug-in interface are available on the [DataTables web-site](//datatables.net). The site also contains information on the wide variety of plug-ins that are available for DataTables, which can be used to enhance and customise your table even further.
44   -
45   -
46   -## Support
47   -
48   -Support for DataTables is available through the [DataTables forums](//datatables.net/forums) and [commercial support options](//datatables.net/support) are available.
49   -
50   -
51   -## License
52   -
53   -DataTables is release under the [MIT license](//datatables.net/license). You are free to use, modify and distribute this software, as long as the copyright header is left intact (specifically the comment block which starts with `/*!`.
datalets/datatable-datalet/js/DataTables-1.10.5/bower.json deleted
1   -{
2   - "name": "datatables",
3   - "version": "1.10.5",
4   - "main": [
5   - "media/js/jquery.dataTables.js",
6   - "media/css/jquery.dataTables.css",
7   - "media/images/*.png"
8   - ],
9   - "dependencies": {
10   - "jquery": ">=1.7.0"
11   - },
12   - "license": "MIT",
13   - "keywords": [
14   - "jquery",
15   - "datatables",
16   - "table",
17   - "javascript",
18   - "library"
19   - ],
20   - "ignore": [
21   - "/.*",
22   - "examples",
23   - "media/unit_testing",
24   - "composer.json",
25   - "dataTables.jquery.json",
26   - "package.json"
27   - ]
28   -}
datalets/datatable-datalet/js/DataTables-1.10.5/composer.json deleted
1   -{
2   - "name": "datatables/datatables",
3   - "version": "1.10.5",
4   - "description": "DataTables is a plug-in for the jQuery Javascript library. It is a highly flexible tool, based upon the foundations of progressive enhancement, which will add advanced interaction controls to any HTML table.",
5   - "homepage": "http://www.datatables.net/",
6   - "author": "SpryMedia",
7   - "license": [
8   - "MIT"
9   - ],
10   - "prefer-stable": true,
11   - "support": {
12   - "forum": "https://datatables.net/forums",
13   - "source": "https://github.com/DataTables/DataTablesSrc/"
14   - }
15   -}
datalets/datatable-datalet/js/DataTables-1.10.5/dataTables.jquery.json deleted
1   -{
2   - "name": "DataTables",
3   - "version": "1.10.5",
4   - "description": "DataTables enhances HTML tables with the ability to sort, filter and page the data in the table very easily. It provides a comprehensive API and set of configuration options, allowing you to consume data from virtually any data source.",
5   - "homepage": "http://datatables.net/",
6   - "docs": "http://datatables.net/",
7   - "demo": "http://datatables.net/examples",
8   - "download": "http://datatables.net/download",
9   - "author": {
10   - "name": "Allan Jardine",
11   - "url": "http://sprymedia.co.uk"
12   - },
13   - "licenses": [
14   - {
15   - "type": "MIT",
16   - "url": "http://datatables.net/license_bsd"
17   - }
18   - ],
19   - "dependencies": {
20   - "jquery": ">=1.7"
21   - },
22   - "keywords": [
23   - "DataTables",
24   - "DataTable",
25   - "table",
26   - "grid",
27   - "filter",
28   - "sort",
29   - "page",
30   - "internationalisable"
31   - ]
32   -}
datalets/datatable-datalet/js/DataTables-1.10.5/examples/advanced_init/column_render.html deleted
1   -<!DOCTYPE html>
2   -<html>
3   -<head>
4   - <meta charset="utf-8">
5   - <link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico">
6   - <meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0">
7   -
8   - <title>DataTables example - Column rendering</title>
9   - <link rel="stylesheet" type="text/css" href="../../media/css/jquery.dataTables.css">
10   - <link rel="stylesheet" type="text/css" href="../resources/syntax/shCore.css">
11   - <link rel="stylesheet" type="text/css" href="../resources/demo.css">
12   - <style type="text/css" class="init">
13   -
14   - </style>
15   - <script type="text/javascript" language="javascript" src="../../media/js/jquery.js"></script>
16   - <script type="text/javascript" language="javascript" src="../../media/js/jquery.dataTables.js"></script>
17   - <script type="text/javascript" language="javascript" src="../resources/syntax/shCore.js"></script>
18   - <script type="text/javascript" language="javascript" src="../resources/demo.js"></script>
19   - <script type="text/javascript" language="javascript" class="init">
20   -
21   -
22   -$(document).ready(function() {
23   - $('#example').dataTable( {
24   - "columnDefs": [
25   - {
26   - // The `data` parameter refers to the data for the cell (defined by the
27   - // `data` option, which defaults to the column being worked with, in
28   - // this case `data: 0`.
29   - "render": function ( data, type, row ) {
30   - return data +' ('+ row[3]+')';
31   - },
32   - "targets": 0
33   - },
34   - { "visible": false, "targets": [ 3 ] }
35   - ]
36   - } );
37   -} );
38   -
39   -
40   - </script>
41   -</head>
42   -
43   -<body class="dt-example">
44   - <div class="container">
45   - <section>
46   - <h1>DataTables example <span>Column rendering</span></h1>
47   -
48   - <div class="info">
49   - <p>Each column has an optional rendering control called <a href="//datatables.net/reference/option/columns.render"><code class="option" title=
50   - "DataTables initialisation option">columns.render<span>DT</span></code></a> which can be used to process the content of each cell before the data is used. <a href=
51   - "//datatables.net/reference/option/columns.render"><code class="option" title="DataTables initialisation option">columns.render<span>DT</span></code></a> has a
52   - wide array of options available to it for rendering different types of data orthogonally (ordering, searching, display etc), but it can be used very simply to
53   - manipulate the content of a cell, as shown here.</p>
54   -
55   - <p>This example shows the person's age combined with their name in the first column, hiding the age column. This technique can be useful for adding links,
56   - assigning colours based on content rules and any other form of text manipulation you require.</p>
57   - </div>
58   -
59   - <table id="example" class="display" cellspacing="0" width="100%">
60   - <thead>
61   - <tr>
62   - <th>Name</th>
63   - <th>Position</th>
64   - <th>Office</th>
65   - <th>Age</th>
66   - <th>Start date</th>
67   - <th>Salary</th>
68   - </tr>
69   - </thead>
70   -
71   - <tfoot>
72   - <tr>
73   - <th>Name</th>
74   - <th>Position</th>
75   - <th>Office</th>
76   - <th>Age</th>
77   - <th>Start date</th>
78   - <th>Salary</th>
79   - </tr>
80   - </tfoot>
81   -
82   - <tbody>
83   - <tr>
84   - <td>Tiger Nixon</td>
85   - <td>System Architect</td>
86   - <td>Edinburgh</td>
87   - <td>61</td>
88   - <td>2011/04/25</td>
89   - <td>$320,800</td>
90   - </tr>
91   - <tr>
92   - <td>Garrett Winters</td>
93   - <td>Accountant</td>
94   - <td>Tokyo</td>
95   - <td>63</td>
96   - <td>2011/07/25</td>
97   - <td>$170,750</td>
98   - </tr>
99   - <tr>
100   - <td>Ashton Cox</td>
101   - <td>Junior Technical Author</td>
102   - <td>San Francisco</td>
103   - <td>66</td>
104   - <td>2009/01/12</td>
105   - <td>$86,000</td>
106   - </tr>
107   - <tr>
108   - <td>Cedric Kelly</td>
109   - <td>Senior Javascript Developer</td>
110   - <td>Edinburgh</td>
111   - <td>22</td>
112   - <td>2012/03/29</td>
113   - <td>$433,060</td>
114   - </tr>
115   - <tr>
116   - <td>Airi Satou</td>
117   - <td>Accountant</td>
118   - <td>Tokyo</td>
119   - <td>33</td>
120   - <td>2008/11/28</td>
121   - <td>$162,700</td>
122   - </tr>
123   - <tr>
124   - <td>Brielle Williamson</td>
125   - <td>Integration Specialist</td>
126   - <td>New York</td>
127   - <td>61</td>
128   - <td>2012/12/02</td>
129   - <td>$372,000</td>
130   - </tr>
131   - <tr>
132   - <td>Herrod Chandler</td>
133   - <td>Sales Assistant</td>
134   - <td>San Francisco</td>
135   - <td>59</td>
136   - <td>2012/08/06</td>
137   - <td>$137,500</td>
138   - </tr>
139   - <tr>
140   - <td>Rhona Davidson</td>
141   - <td>Integration Specialist</td>
142   - <td>Tokyo</td>
143   - <td>55</td>
144   - <td>2010/10/14</td>
145   - <td>$327,900</td>
146   - </tr>
147   - <tr>
148   - <td>Colleen Hurst</td>
149   - <td>Javascript Developer</td>
150   - <td>San Francisco</td>
151   - <td>39</td>
152   - <td>2009/09/15</td>
153   - <td>$205,500</td>
154   - </tr>
155   - <tr>
156   - <td>Sonya Frost</td>
157   - <td>Software Engineer</td>
158   - <td>Edinburgh</td>
159   - <td>23</td>
160   - <td>2008/12/13</td>
161   - <td>$103,600</td>
162   - </tr>
163   - <tr>
164   - <td>Jena Gaines</td>
165   - <td>Office Manager</td>
166   - <td>London</td>
167   - <td>30</td>
168   - <td>2008/12/19</td>
169   - <td>$90,560</td>
170   - </tr>
171   - <tr>
172   - <td>Quinn Flynn</td>
173   - <td>Support Lead</td>
174   - <td>Edinburgh</td>
175   - <td>22</td>
176   - <td>2013/03/03</td>
177   - <td>$342,000</td>
178   - </tr>
179   - <tr>
180   - <td>Charde Marshall</td>
181   - <td>Regional Director</td>
182   - <td>San Francisco</td>
183   - <td>36</td>
184   - <td>2008/10/16</td>
185   - <td>$470,600</td>
186   - </tr>
187   - <tr>
188   - <td>Haley Kennedy</td>
189   - <td>Senior Marketing Designer</td>
190   - <td>London</td>
191   - <td>43</td>
192   - <td>2012/12/18</td>
193   - <td>$313,500</td>
194   - </tr>
195   - <tr>
196   - <td>Tatyana Fitzpatrick</td>
197   - <td>Regional Director</td>
198   - <td>London</td>
199   - <td>19</td>
200   - <td>2010/03/17</td>
201   - <td>$385,750</td>
202   - </tr>
203   - <tr>
204   - <td>Michael Silva</td>
205   - <td>Marketing Designer</td>
206   - <td>London</td>
207   - <td>66</td>
208   - <td>2012/11/27</td>
209   - <td>$198,500</td>
210   - </tr>
211   - <tr>
212   - <td>Paul Byrd</td>
213   - <td>Chief Financial Officer (CFO)</td>
214   - <td>New York</td>
215   - <td>64</td>
216   - <td>2010/06/09</td>
217   - <td>$725,000</td>
218   - </tr>
219   - <tr>
220   - <td>Gloria Little</td>
221   - <td>Systems Administrator</td>
222   - <td>New York</td>
223   - <td>59</td>
224   - <td>2009/04/10</td>
225   - <td>$237,500</td>
226   - </tr>
227   - <tr>
228   - <td>Bradley Greer</td>
229   - <td>Software Engineer</td>
230   - <td>London</td>
231   - <td>41</td>
232   - <td>2012/10/13</td>
233   - <td>$132,000</td>
234   - </tr>
235   - <tr>
236   - <td>Dai Rios</td>
237   - <td>Personnel Lead</td>
238   - <td>Edinburgh</td>
239   - <td>35</td>
240   - <td>2012/09/26</td>
241   - <td>$217,500</td>
242   - </tr>
243   - <tr>
244   - <td>Jenette Caldwell</td>
245   - <td>Development Lead</td>
246   - <td>New York</td>
247   - <td>30</td>
248   - <td>2011/09/03</td>
249   - <td>$345,000</td>
250   - </tr>
251   - <tr>
252   - <td>Yuri Berry</td>
253   - <td>Chief Marketing Officer (CMO)</td>
254   - <td>New York</td>
255   - <td>40</td>
256   - <td>2009/06/25</td>
257   - <td>$675,000</td>
258   - </tr>
259   - <tr>
260   - <td>Caesar Vance</td>
261   - <td>Pre-Sales Support</td>
262   - <td>New York</td>
263   - <td>21</td>
264   - <td>2011/12/12</td>
265   - <td>$106,450</td>
266   - </tr>
267   - <tr>
268   - <td>Doris Wilder</td>
269   - <td>Sales Assistant</td>
270   - <td>Sidney</td>
271   - <td>23</td>
272   - <td>2010/09/20</td>
273   - <td>$85,600</td>
274   - </tr>
275   - <tr>
276   - <td>Angelica Ramos</td>
277   - <td>Chief Executive Officer (CEO)</td>
278   - <td>London</td>
279   - <td>47</td>
280   - <td>2009/10/09</td>
281   - <td>$1,200,000</td>
282   - </tr>
283   - <tr>
284   - <td>Gavin Joyce</td>
285   - <td>Developer</td>
286   - <td>Edinburgh</td>
287   - <td>42</td>
288   - <td>2010/12/22</td>
289   - <td>$92,575</td>
290   - </tr>
291   - <tr>
292   - <td>Jennifer Chang</td>
293   - <td>Regional Director</td>
294   - <td>Singapore</td>
295   - <td>28</td>
296   - <td>2010/11/14</td>
297   - <td>$357,650</td>
298   - </tr>
299   - <tr>
300   - <td>Brenden Wagner</td>
301   - <td>Software Engineer</td>
302   - <td>San Francisco</td>
303   - <td>28</td>
304   - <td>2011/06/07</td>
305   - <td>$206,850</td>
306   - </tr>
307   - <tr>
308   - <td>Fiona Green</td>
309   - <td>Chief Operating Officer (COO)</td>
310   - <td>San Francisco</td>
311   - <td>48</td>
312   - <td>2010/03/11</td>
313   - <td>$850,000</td>
314   - </tr>
315   - <tr>
316   - <td>Shou Itou</td>
317   - <td>Regional Marketing</td>
318   - <td>Tokyo</td>
319   - <td>20</td>
320   - <td>2011/08/14</td>
321   - <td>$163,000</td>
322   - </tr>
323   - <tr>
324   - <td>Michelle House</td>
325   - <td>Integration Specialist</td>
326   - <td>Sidney</td>
327   - <td>37</td>
328   - <td>2011/06/02</td>
329   - <td>$95,400</td>
330   - </tr>
331   - <tr>
332   - <td>Suki Burks</td>
333   - <td>Developer</td>
334   - <td>London</td>
335   - <td>53</td>
336   - <td>2009/10/22</td>
337   - <td>$114,500</td>
338   - </tr>
339   - <tr>
340   - <td>Prescott Bartlett</td>
341   - <td>Technical Author</td>
342   - <td>London</td>
343   - <td>27</td>
344   - <td>2011/05/07</td>
345   - <td>$145,000</td>
346   - </tr>
347   - <tr>
348   - <td>Gavin Cortez</td>
349   - <td>Team Leader</td>
350   - <td>San Francisco</td>
351   - <td>22</td>
352   - <td>2008/10/26</td>
353   - <td>$235,500</td>
354   - </tr>
355   - <tr>
356   - <td>Martena Mccray</td>
357   - <td>Post-Sales support</td>
358   - <td>Edinburgh</td>
359   - <td>46</td>
360   - <td>2011/03/09</td>
361   - <td>$324,050</td>
362   - </tr>
363   - <tr>
364   - <td>Unity Butler</td>
365   - <td>Marketing Designer</td>
366   - <td>San Francisco</td>
367   - <td>47</td>
368   - <td>2009/12/09</td>
369   - <td>$85,675</td>
370   - </tr>
371   - <tr>
372   - <td>Howard Hatfield</td>
373   - <td>Office Manager</td>
374   - <td>San Francisco</td>
375   - <td>51</td>
376   - <td>2008/12/16</td>
377   - <td>$164,500</td>
378   - </tr>
379   - <tr>
380   - <td>Hope Fuentes</td>
381   - <td>Secretary</td>
382   - <td>San Francisco</td>
383   - <td>41</td>
384   - <td>2010/02/12</td>
385   - <td>$109,850</td>
386   - </tr>
387   - <tr>
388   - <td>Vivian Harrell</td>
389   - <td>Financial Controller</td>
390   - <td>San Francisco</td>
391   - <td>62</td>
392   - <td>2009/02/14</td>
393   - <td>$452,500</td>
394   - </tr>
395   - <tr>
396   - <td>Timothy Mooney</td>
397   - <td>Office Manager</td>
398   - <td>London</td>
399   - <td>37</td>
400   - <td>2008/12/11</td>
401   - <td>$136,200</td>
402   - </tr>
403   - <tr>
404   - <td>Jackson Bradshaw</td>
405   - <td>Director</td>
406   - <td>New York</td>
407   - <td>65</td>
408   - <td>2008/09/26</td>
409   - <td>$645,750</td>
410   - </tr>
411   - <tr>
412   - <td>Olivia Liang</td>
413   - <td>Support Engineer</td>
414   - <td>Singapore</td>
415   - <td>64</td>
416   - <td>2011/02/03</td>
417   - <td>$234,500</td>
418   - </tr>
419   - <tr>
420   - <td>Bruno Nash</td>
421   - <td>Software Engineer</td>
422   - <td>London</td>
423   - <td>38</td>
424   - <td>2011/05/03</td>
425   - <td>$163,500</td>
426   - </tr>
427   - <tr>
428   - <td>Sakura Yamamoto</td>
429   - <td>Support Engineer</td>
430   - <td>Tokyo</td>
431   - <td>37</td>
432   - <td>2009/08/19</td>
433   - <td>$139,575</td>
434   - </tr>
435   - <tr>
436   - <td>Thor Walton</td>
437   - <td>Developer</td>
438   - <td>New York</td>
439   - <td>61</td>
440   - <td>2013/08/11</td>
441   - <td>$98,540</td>
442   - </tr>
443   - <tr>
444   - <td>Finn Camacho</td>
445   - <td>Support Engineer</td>
446   - <td>San Francisco</td>
447   - <td>47</td>
448   - <td>2009/07/07</td>
449   - <td>$87,500</td>
450   - </tr>
451   - <tr>
452   - <td>Serge Baldwin</td>
453   - <td>Data Coordinator</td>
454   - <td>Singapore</td>
455   - <td>64</td>
456   - <td>2012/04/09</td>
457   - <td>$138,575</td>
458   - </tr>
459   - <tr>
460   - <td>Zenaida Frank</td>
461   - <td>Software Engineer</td>
462   - <td>New York</td>
463   - <td>63</td>
464   - <td>2010/01/04</td>
465   - <td>$125,250</td>
466   - </tr>
467   - <tr>
468   - <td>Zorita Serrano</td>
469   - <td>Software Engineer</td>
470   - <td>San Francisco</td>
471   - <td>56</td>
472   - <td>2012/06/01</td>
473   - <td>$115,000</td>
474   - </tr>
475   - <tr>
476   - <td>Jennifer Acosta</td>
477   - <td>Junior Javascript Developer</td>
478   - <td>Edinburgh</td>
479   - <td>43</td>
480   - <td>2013/02/01</td>
481   - <td>$75,650</td>
482   - </tr>
483   - <tr>
484   - <td>Cara Stevens</td>
485   - <td>Sales Assistant</td>
486   - <td>New York</td>
487   - <td>46</td>
488   - <td>2011/12/06</td>
489   - <td>$145,600</td>
490   - </tr>
491   - <tr>
492   - <td>Hermione Butler</td>
493   - <td>Regional Director</td>
494   - <td>London</td>
495   - <td>47</td>
496   - <td>2011/03/21</td>
497   - <td>$356,250</td>
498   - </tr>
499   - <tr>
500   - <td>Lael Greer</td>
501   - <td>Systems Administrator</td>
502   - <td>London</td>
503   - <td>21</td>
504   - <td>2009/02/27</td>
505   - <td>$103,500</td>
506   - </tr>
507   - <tr>
508   - <td>Jonas Alexander</td>
509   - <td>Developer</td>
510   - <td>San Francisco</td>
511   - <td>30</td>
512   - <td>2010/07/14</td>
513   - <td>$86,500</td>
514   - </tr>
515   - <tr>
516   - <td>Shad Decker</td>
517   - <td>Regional Director</td>
518   - <td>Edinburgh</td>
519   - <td>51</td>
520   - <td>2008/11/13</td>
521   - <td>$183,000</td>
522   - </tr>
523   - <tr>
524   - <td>Michael Bruce</td>
525   - <td>Javascript Developer</td>
526   - <td>Singapore</td>
527   - <td>29</td>
528   - <td>2011/06/27</td>
529   - <td>$183,000</td>
530   - </tr>
531   - <tr>
532   - <td>Donna Snider</td>
533   - <td>Customer Support</td>
534   - <td>New York</td>
535   - <td>27</td>
536   - <td>2011/01/25</td>
537   - <td>$112,000</td>
538   - </tr>
539   - </tbody>
540   - </table>
541   -
542   - <ul class="tabs">
543   - <li class="active">Javascript</li>
544   - <li>HTML</li>
545   - <li>CSS</li>
546   - <li>Ajax</li>
547   - <li>Server-side script</li>
548   - </ul>
549   -
550   - <div class="tabs">
551   - <div class="js">
552   - <p>The Javascript shown below is used to initialise the table shown in this example:</p><code class="multiline language-js">$(document).ready(function() {
553   - $('#example').dataTable( {
554   - &quot;columnDefs&quot;: [
555   - {
556   - // The `data` parameter refers to the data for the cell (defined by the
557   - // `data` option, which defaults to the column being worked with, in
558   - // this case `data: 0`.
559   - &quot;render&quot;: function ( data, type, row ) {
560   - return data +' ('+ row[3]+')';
561   - },
562   - &quot;targets&quot;: 0
563   - },
564   - { &quot;visible&quot;: false, &quot;targets&quot;: [ 3 ] }
565   - ]
566   - } );
567   -} );</code>
568   -
569   - <p>In addition to the above code, the following Javascript library files are loaded for use in this example:</p>
570   -
571   - <ul>
572   - <li><a href="../../media/js/jquery.js">../../media/js/jquery.js</a></li>
573   - <li><a href="../../media/js/jquery.dataTables.js">../../media/js/jquery.dataTables.js</a></li>
574   - </ul>
575   - </div>
576   -
577   - <div class="table">
578   - <p>The HTML shown below is the raw HTML table element, before it has been enhanced by DataTables:</p>
579   - </div>
580   -
581   - <div class="css">
582   - <div>
583   - <p>This example uses a little bit of additional CSS beyond what is loaded from the library files (below), in order to correctly display the table. The
584   - additional CSS used is shown below:</p><code class="multiline language-css"></code>
585   - </div>
586   -
587   - <p>The following CSS library files are loaded for use in this example to provide the styling of the table:</p>
588   -
589   - <ul>
590   - <li><a href="../../media/css/jquery.dataTables.css">../../media/css/jquery.dataTables.css</a></li>
591   - </ul>
592   - </div>
593   -
594   - <div class="ajax">
595   - <p>This table loads data by Ajax. The latest data that has been loaded is shown below. This data will update automatically as any additional data is
596   - loaded.</p>
597   - </div>
598   -
599   - <div class="php">
600   - <p>The script used to perform the server-side processing for this table is shown below. Please note that this is just an example script using PHP. Server-side
601   - processing scripts can be written in any language, using <a href="//datatables.net/manual/server-side">the protocol described in the DataTables
602   - documentation</a>.</p>
603   - </div>
604   - </div>
605   - </section>
606   - </div>
607   -
608   - <section>
609   - <div class="footer">
610   - <div class="gradient"></div>
611   -
612   - <div class="liner">
613   - <h2>Other examples</h2>
614   -
615   - <div class="toc">
616   - <div class="toc-group">
617   - <h3><a href="../basic_init/index.html">Basic initialisation</a></h3>
618   - <ul class="toc">
619   - <li><a href="../basic_init/zero_configuration.html">Zero configuration</a></li>
620   - <li><a href="../basic_init/filter_only.html">Feature enable / disable</a></li>
621   - <li><a href="../basic_init/table_sorting.html">Default ordering (sorting)</a></li>
622   - <li><a href="../basic_init/multi_col_sort.html">Multi-column ordering</a></li>
623   - <li><a href="../basic_init/multiple_tables.html">Multiple tables</a></li>
624   - <li><a href="../basic_init/hidden_columns.html">Hidden columns</a></li>
625   - <li><a href="../basic_init/complex_header.html">Complex headers (rowspan and colspan)</a></li>
626   - <li><a href="../basic_init/dom.html">DOM positioning</a></li>
627   - <li><a href="../basic_init/flexible_width.html">Flexible table width</a></li>
628   - <li><a href="../basic_init/state_save.html">State saving</a></li>
629   - <li><a href="../basic_init/alt_pagination.html">Alternative pagination</a></li>
630   - <li><a href="../basic_init/scroll_y.html">Scroll - vertical</a></li>
631   - <li><a href="../basic_init/scroll_x.html">Scroll - horizontal</a></li>
632   - <li><a href="../basic_init/scroll_xy.html">Scroll - horizontal and vertical</a></li>
633   - <li><a href="../basic_init/scroll_y_theme.html">Scroll - vertical with jQuery UI ThemeRoller</a></li>
634   - <li><a href="../basic_init/comma-decimal.html">Language - Comma decimal place</a></li>
635   - <li><a href="../basic_init/language.html">Language options</a></li>
636   - </ul>
637   - </div>
638   -
639   - <div class="toc-group">
640   - <h3><a href="./index.html">Advanced initialisation</a></h3>
641   - <ul class="toc active">
642   - <li><a href="./events_live.html">DOM / jQuery events</a></li>
643   - <li><a href="./dt_events.html">DataTables events</a></li>
644   - <li class="active"><a href="./column_render.html">Column rendering</a></li>
645   - <li><a href="./length_menu.html">Page length options</a></li>
646   - <li><a href="./dom_multiple_elements.html">Multiple table control elements</a></li>
647   - <li><a href="./complex_header.html">Complex headers (rowspan / colspan)</a></li>
648   - <li><a href="./object_dom_read.html">Read HTML to data objects</a></li>
649   - <li><a href="./html5-data-attributes.html">HTML5 data-* attributes - cell data</a></li>
650   - <li><a href="./html5-data-options.html">HTML5 data-* attributes - table options</a></li>
651   - <li><a href="./language_file.html">Language file</a></li>
652   - <li><a href="./defaults.html">Setting defaults</a></li>
653   - <li><a href="./row_callback.html">Row created callback</a></li>
654   - <li><a href="./row_grouping.html">Row grouping</a></li>
655   - <li><a href="./footer_callback.html">Footer callback</a></li>
656   - <li><a href="./dom_toolbar.html">Custom toolbar elements</a></li>
657   - <li><a href="./sort_direction_control.html">Order direction sequence control</a></li>
658   - </ul>
659   - </div>
660   -
661   - <div class="toc-group">
662   - <h3><a href="../styling/index.html">Styling</a></h3>
663   - <ul class="toc">
664   - <li><a href="../styling/display.html">Base style</a></li>
665   - <li><a href="../styling/no-classes.html">Base style - no styling classes</a></li>
666   - <li><a href="../styling/cell-border.html">Base style - cell borders</a></li>
667   - <li><a href="../styling/compact.html">Base style - compact</a></li>
668   - <li><a href="../styling/hover.html">Base style - hover</a></li>
669   - <li><a href="../styling/order-column.html">Base style - order-column</a></li>
670   - <li><a href="../styling/row-border.html">Base style - row borders</a></li>
671   - <li><a href="../styling/stripe.html">Base style - stripe</a></li>
672   - <li><a href="../styling/bootstrap.html">Bootstrap</a></li>
673   - <li><a href="../styling/foundation.html">Foundation</a></li>
674   - <li><a href="../styling/jqueryUI.html">jQuery UI ThemeRoller</a></li>
675   - </ul>
676   - </div>
677   -
678   - <div class="toc-group">
679   - <h3><a href="../data_sources/index.html">Data sources</a></h3>
680   - <ul class="toc">
681   - <li><a href="../data_sources/dom.html">HTML (DOM) sourced data</a></li>
682   - <li><a href="../data_sources/ajax.html">Ajax sourced data</a></li>
683   - <li><a href="../data_sources/js_array.html">Javascript sourced data</a></li>
684   - <li><a href="../data_sources/server_side.html">Server-side processing</a></li>
685   - </ul>
686   - </div>
687   -
688   - <div class="toc-group">
689   - <h3><a href="../api/index.html">API</a></h3>
690   - <ul class="toc">
691   - <li><a href="../api/add_row.html">Add rows</a></li>
692   - <li><a href="../api/multi_filter.html">Individual column searching (text inputs)</a></li>
693   - <li><a href="../api/multi_filter_select.html">Individual column searching (select inputs)</a></li>
694   - <li><a href="../api/highlight.html">Highlighting rows and columns</a></li>
695   - <li><a href="../api/row_details.html">Child rows (show extra / detailed information)</a></li>
696   - <li><a href="../api/select_row.html">Row selection (multiple rows)</a></li>
697   - <li><a href="../api/select_single_row.html">Row selection and deletion (single row)</a></li>
698   - <li><a href="../api/form.html">Form inputs</a></li>
699   - <li><a href="../api/counter_columns.html">Index column</a></li>
700   - <li><a href="../api/show_hide.html">Show / hide columns dynamically</a></li>
701   - <li><a href="../api/api_in_init.html">Using API in callbacks</a></li>
702   - <li><a href="../api/tabs_and_scrolling.html">Scrolling and jQuery UI tabs</a></li>
703   - <li><a href="../api/regex.html">Search API (regular expressions)</a></li>
704   - </ul>
705   - </div>
706   -
707   - <div class="toc-group">
708   - <h3><a href="../ajax/index.html">Ajax</a></h3>
709   - <ul class="toc">
710   - <li><a href="../ajax/simple.html">Ajax data source (arrays)</a></li>
711   - <li><a href="../ajax/objects.html">Ajax data source (objects)</a></li>
712   - <li><a href="../ajax/deep.html">Nested object data (objects)</a></li>
713   - <li><a href="../ajax/objects_subarrays.html">Nested object data (arrays)</a></li>
714   - <li><a href="../ajax/orthogonal-data.html">Orthogonal data</a></li>
715   - <li><a href="../ajax/null_data_source.html">Generated content for a column</a></li>
716   - <li><a href="../ajax/custom_data_property.html">Custom data source property</a></li>
717   - <li><a href="../ajax/custom_data_flat.html">Flat array data source</a></li>
718   - <li><a href="../ajax/defer_render.html">Deferred rendering for speed</a></li>
719   - </ul>
720   - </div>
721   -
722   - <div class="toc-group">
723   - <h3><a href="../server_side/index.html">Server-side</a></h3>
724   - <ul class="toc">
725   - <li><a href="../server_side/simple.html">Server-side processing</a></li>
726   - <li><a href="../server_side/custom_vars.html">Custom HTTP variables</a></li>
727   - <li><a href="../server_side/post.html">POST data</a></li>
728   - <li><a href="../server_side/ids.html">Automatic addition of row ID attributes</a></li>
729   - <li><a href="../server_side/object_data.html">Object data source</a></li>
730   - <li><a href="../server_side/row_details.html">Row details</a></li>
731   - <li><a href="../server_side/select_rows.html">Row selection</a></li>
732   - <li><a href="../server_side/jsonp.html">JSONP data source for remote domains</a></li>
733   - <li><a href="../server_side/defer_loading.html">Deferred loading of data</a></li>
734   - <li><a href="../server_side/pipeline.html">Pipelining data to reduce Ajax calls for paging</a></li>
735   - </ul>
736   - </div>
737   -
738   - <div class="toc-group">
739   - <h3><a href="../plug-ins/index.html">Plug-ins</a></h3>
740   - <ul class="toc">
741   - <li><a href="../plug-ins/api.html">API plug-in methods</a></li>
742   - <li><a href="../plug-ins/sorting_auto.html">Ordering plug-ins (with type detection)</a></li>
743   - <li><a href="../plug-ins/sorting_manual.html">Ordering plug-ins (no type detection)</a></li>
744   - <li><a href="../plug-ins/range_filtering.html">Custom filtering - range search</a></li>
745   - <li><a href="../plug-ins/dom_sort.html">Live DOM ordering</a></li>
746   - </ul>
747   - </div>
748   - </div>
749   -
750   - <div class="epilogue">
751   - <p>Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full information about its API properties and methods.<br>
752   - Additionally, there are a wide range of <a href="http://www.datatables.net/extras">extras</a> and <a href="http://www.datatables.net/plug-ins">plug-ins</a>
753   - which extend the capabilities of DataTables.</p>
754   -
755   - <p class="copyright">DataTables designed and created by <a href="http://www.sprymedia.co.uk">SpryMedia Ltd</a> &#169; 2007-2015<br>
756   - DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.</p>
757   - </div>
758   - </div>
759   - </div>
760   - </section>
761   -</body>
762   -</html>
763 0 \ No newline at end of file
datalets/datatable-datalet/js/DataTables-1.10.5/examples/advanced_init/complex_header.html deleted
1   -<!DOCTYPE html>
2   -<html>
3   -<head>
4   - <meta charset="utf-8">
5   - <link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico">
6   - <meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0">
7   -
8   - <title>DataTables example - Complex headers (rowspan / colspan)</title>
9   - <link rel="stylesheet" type="text/css" href="../../media/css/jquery.dataTables.css">
10   - <link rel="stylesheet" type="text/css" href="../resources/syntax/shCore.css">
11   - <link rel="stylesheet" type="text/css" href="../resources/demo.css">
12   - <style type="text/css" class="init">
13   -
14   - </style>
15   - <script type="text/javascript" language="javascript" src="../../media/js/jquery.js"></script>
16   - <script type="text/javascript" language="javascript" src="../../media/js/jquery.dataTables.js"></script>
17   - <script type="text/javascript" language="javascript" src="../resources/syntax/shCore.js"></script>
18   - <script type="text/javascript" language="javascript" src="../resources/demo.js"></script>
19   - <script type="text/javascript" language="javascript" class="init">
20   -
21   -
22   -$(document).ready(function() {
23   - $('#example').dataTable( {
24   - "columnDefs": [ {
25   - "visible": false,
26   - "targets": -1
27   - } ]
28   - } );
29   -} );
30   -
31   -
32   - </script>
33   -</head>
34   -
35   -<body class="dt-example">
36   - <div class="container">
37   - <section>
38   - <h1>DataTables example <span>Complex headers (rowspan / colspan)</span></h1>
39   -
40   - <div class="info">
41   - <p>Complex headers (using colspan / rowspan) can be used to group columns of similar information in DataTables, creating a very powerful visual effect.</p>
42   -
43   - <p>In addition to the basic behaviour, DataTables can also take colspan and rowspans into account when working with hidden columns. The colspan and rowspan
44   - attributes for each cell are automatically calculated and rendered on the page for you. This allows the <a href=
45   - "//datatables.net/reference/option/columns.visible"><code class="option" title="DataTables initialisation option">columns.visible<span>DT</span></code></a> option
46   - and <a href="//datatables.net/reference/api/column().visible()"><code class="api" title="DataTables API method">column().visible()<span>DT</span></code></a> method
47   - to take into account rowspan / colspan cells, drawing the header correctly.</p>
48   -
49   - <p>Note that each column must have at least one unique cell (i.e. a cell without colspan) so DataTables can use that cell to detect the column and use it to apply
50   - ordering.</p>
51   -
52   - <p>The example below shows a header spanning multiple cells over the contact information, with one of the columns that the span covers being hidden.</p>
53   - </div>
54   -
55   - <table id="example" class="display" cellspacing="0" width="100%">
56   - <thead>
57   - <tr>
58   - <th rowspan="2">Name</th>
59   - <th colspan="2">HR Information</th>
60   - <th colspan="3">Contact</th>
61   - </tr>
62   - <tr>
63   - <th>Position</th>
64   - <th>Salary</th>
65   - <th>Office</th>
66   - <th>Extn.</th>
67   - <th>E-mail</th>
68   - </tr>
69   - </thead>
70   -
71   - <tfoot>
72   - <tr>
73   - <th>Name</th>
74   - <th>Position</th>
75   - <th>Salary</th>
76   - <th>Office</th>
77   - <th>Extn.</th>
78   - <th>E-mail</th>
79   - </tr>
80   - </tfoot>