1 sdump('D_TRACE','Loading list_box.js\n');
3 function list_box_init( p ) {
4 sdump('D_LIST_BOX',"TESTING: list_box.js: " + mw.G['main_test_variable'] + '\n');
5 sdump('D_CONSTRUCTOR',arg_dump(arguments));
7 p.listbox = p.w.document.createElement('listbox');
8 p.node.appendChild( p.listbox );
9 p.listbox.setAttribute('flex','1');
10 p.listbox.setAttribute('seltype','multiple');
12 var listhead = p.w.document.createElement('listhead');
13 p.listbox.appendChild( listhead );
15 var listcols = p.w.document.createElement('listcols');
16 p.listbox.appendChild( listcols );
18 /*if (window.navigator.userAgent.match( /Firefox/ ))*/ {
19 //sdump('D_FIREFOX','Kludge: Adding extra listheader and listcol\n');
20 var listheader = p.w.document.createElement('listheader');
21 listhead.appendChild( listheader );
22 listheader.setAttribute('label', '');
23 var listcol = p.w.document.createElement('listcol');
24 listcols.appendChild( listcol );
27 for (var i = 0; i < p.cols.length; i++ ) {
29 var listheader = p.w.document.createElement('listheader');
30 listhead.appendChild( listheader );
31 listheader.setAttribute('label', p.cols[i].label);
33 var listcol = p.w.document.createElement('listcol');
34 listcols.appendChild( listcol );
35 listcol.setAttribute('flex', p.cols[i].flex);
38 p.add_row = function (cols, params) {
40 var listitem = p.w.document.createElement('listitem');
41 p.listbox.appendChild( listitem );
42 listitem.setAttribute('allowevents','true');
43 listitem.setAttribute('style','border-bottom: black solid thin');
44 for (var i in params) {
45 listitem.setAttribute( i, params[i] );
48 /* if (window.navigator.userAgent.match( /Firefox/ )) */ {
49 //sdump('D_FIREFOX','Kludge: Setting label on listitem\n');
50 listitem.setAttribute('label',' ');
53 for (var i = 0; i < cols.length; i++) {
56 listitem.appendChild( cols[i] );
58 sdump('D_ERROR', cols[i] + '\n' + E + '\n');
63 p.clear_rows = function () {
64 var count = p.listbox.getRowCount();
65 for (var i = 0; i < count; i++) {
66 p.listbox.removeChild( p.listbox.lastChild );