File: htmlTableWidget.js

package info (click to toggle)
r-cran-htmltable 2.4.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,600 kB
  • sloc: javascript: 6,797; makefile: 2
file content (39 lines) | stat: -rw-r--r-- 1,071 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
HTMLWidgets.widget({

  name: 'htmlTableWidget',

  type: 'output',

  factory: function(el, width, height) {

    return {

      renderValue: function(x) {
        $(el).empty();
        // Select number of rows to see:
        var select_entries_div = document.createElement('div');
        var select_entries_div_id = (el.id).concat('_entries');
        $(select_entries_div).attr('id', select_entries_div_id);
        $(el).append(select_entries_div);
        // Add the table:
        $(el).append(x.thetable);
        /// The navigation bar:
        var nav_obj = document.createElement('div');
        var nav_id = (el.id).concat('_nav');
        $(nav_obj).attr('id', nav_id);
        $(el).append(nav_obj);
        // Set instance variables:
        var thetable = $(el).find('table');
        $(el).css("position","relative");
        $(el).css("clear","both");
        $(thetable).css("width","100%");
        table_pagination(thetable, nav_id, select_entries_div_id, x.options, el);
      },

      resize: function(width, height) {

      }

    };
  }
});