Revision 903,
1.1 KB
checked in by niltonneto, 15 years ago
(diff) |
Importacao inicial do Expresso do Serpro
|
Rev | Line | |
---|
[903] | 1 | function editField(random, key) |
---|
| 2 | { |
---|
| 3 | var tableCell = document.getElementById(random + '_' + key + '_td'); |
---|
| 4 | tableCell.innerHTML = '<input type="text" id="' + random + '_' + key + '_edit" value="' + document.getElementById(random + '_' + key).value + '"/>'; |
---|
| 5 | tableCell.nextSibling.innerHTML = '<a href="#" onclick="setField(\'' + random + '\', \'' + key + '\'); return false;">ok</a>'; |
---|
| 6 | document.getElementById(random + '_' + key + '_edit').focus(); |
---|
| 7 | } |
---|
| 8 | |
---|
| 9 | function setField(random, key) |
---|
| 10 | { |
---|
| 11 | var tableCell = document.getElementById(random + '_' + key + '_td'); |
---|
| 12 | document.getElementById(random + '_' + key).value = document.getElementById(random + '_' + key + '_edit').value; |
---|
| 13 | tableCell.innerHTML = document.getElementById(random + '_' + key + '_edit').value; |
---|
| 14 | tableCell.nextSibling.innerHTML = '<a href="#" onclick="editField(\'' + random + '\', \'' + key + '\'); return false;">editar</a>'; |
---|
| 15 | } |
---|
| 16 | |
---|
| 17 | function toggleTableDisplay(tableElement) |
---|
| 18 | { |
---|
| 19 | for (var i = 1; i < tableElement.rows.length; i++) |
---|
| 20 | tableElement.rows[i].style.display = (tableElement.rows[i].style.display == 'none') ? '' : 'none'; |
---|
| 21 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.