Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(document).ready(function () {
- var title = 'Page Title';
- var form = $('<form></form>').attr('id', 'form1');
- var div = $('<div></div>').attr('id', 'hasTable');
- var ABT = $('<div></div>').attr('id', 'ABTHolder');
- var table = $('<table></table>').attr('id', 'CETable');
- var head = $('<thead></thead>');
- var tbody = $('<tbody></tbody>');
- var headRow = $('<tr></tr>');
- document.title = title;
- $('body').append(form);
- form.append(div);
- div.append(table);
- //$('body').append(ABT);
- //ABT.append("<input type='button' id='ABTbtn' value='Activate Bypass Timer'/>").button();
- //Create column headers
- table.append(head);
- head.append(headRow);
- for( var i=0; i < $headers1.length; ++i)
- {
- var r1 = $('<th></th>').addClass('r90');
- var sp = $('<span></span>').text($headers1[i]);
- if(i > 5)
- {
- r1.addClass('borderCell2').attr('id', 'th' + i);
- }
- r1.append(sp);
- headRow.append(r1);
- }
- //Create default row (i.e. alternative way to create column headers)
- var tr = $('<tr></tr>').attr('id', 'tr0');
- table.append(tbody);
- tbody.append(tr);
- for( var i=0; i < $headers2.length; ++i)
- {
- var td = $('<td></td>').addClass('borderCell2').text($headers2[i]);
- if(i < 7)
- {
- td.attr('id', 'th' + i)
- }
- tr.append(td);
- }
- $allCells = $("td, th");
- $('#CETable tr').addClass("whiteRow");
- $('#CETable tbody td')
- .on("click", function() {
- $cell = $(this);
- populateVars($(this));
- alert( "ID: " + $trow.find("td:first").text() + " , Value: " + $cell.text() + ", Header: " + $thid.text() );
- })
- .mouseover(function () {
- $cell = $(this);
- populateVars($(this));
- //Highlight Row
- highlightRow($trid);
- //Highligh Column
- highlightColumn($cell)
- })
- .mouseout(function() {
- $cell = $(this);
- populateVars($(this));
- //Un-highligh row
- unHighlightRow($trid)
- //Un-highlight column
- unHighlightColumn();
- });
- // $('#ABTbtn').on("click", function(){
- // alert('ABT!');
- // });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement