123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- define(function () {
- "use strict";
- function DisplayAllValues() {
- };
- DisplayAllValues.prototype.draw = function (oControlHost) {
- var elPVInfo = oControlHost.container;
- elPVInfo.innerHTML =
- '<style>' +
- '.myButtonPromptValueInfo { height:32px; width:180px; cursor:pointer; margin-left:5px; color:#4178BE; font-size:14px; padding:6px 12px 6px 12px; background-color:white; border:1px solid #4178BE; }' +
- '.myButtonPromptValueInfo:hover { background-color:#4178BE; color:white; border:1px solid #4178BE; }' +
- '</style>' +
- '<button class="myButtonPromptValueInfo btnPV" type="button">Get All Prompt Values</button><div></div>';
- elPVInfo.querySelector(".btnPV").onclick = getAllPromptValues.bind(this, oControlHost);
- }
- function getAllPromptValues(oControlHost) {
- var oControl = oControlHost.page.getControlByName("promptProdLine");
- var aValues = oControl.getValues(true);
- //var elValues = oControlHost.container.lastChild;
- var elValues = oControlHost.container.querySelector("div");
- var sTable = '<br/><table><tr><th align="left">Use</th><th align="left">Display</th></tr>';
- for (var j = 0; j < aValues.length; j++) {
- var oValue = aValues[j];
- sTable += '<tr>';
- sTable += '<td width="200px">' + oValue.use + '</td>';
- sTable += '<td width="200px">' + oValue.display +'</td>';
- sTable += '</tr>';
- }
- elValues.innerHTML = sTable;
- };
- return DisplayAllValues;
- }
- );
|