Added 'too few/many' messages to matrix compare box, rfe# 9965
This commit is contained in:
parent
87abb79331
commit
aefb658fd5
6 changed files with 49 additions and 58 deletions
|
|
@ -8,7 +8,7 @@ YAHOO.util.Event.addListener(window, "load", function() {
|
|||
if(typeof(oRecord.getData("checked")) != 'undefined' && oRecord.getData("checked") == 'checked'){
|
||||
innerHTML = innerHTML + " checked='checked'";
|
||||
}
|
||||
innerHTML = innerHTML + " onchange='javascript:compareFormButton()' class='compareCheckBox'>";
|
||||
innerHTML = innerHTML + " class='compareCheckBox'>";
|
||||
elCell.innerHTML = innerHTML;
|
||||
};
|
||||
|
||||
|
|
@ -82,7 +82,7 @@ YAHOO.util.Event.addListener(window, "load", function() {
|
|||
this.onDataReturnAppendRows.apply(this,arguments);
|
||||
};
|
||||
|
||||
window.compareFormButton = function() {
|
||||
var compareFormButton = function() {
|
||||
var compareCheckBoxes = YAHOO.util.Dom.getElementsByClassName('compareCheckBox','input');
|
||||
var checked = 0;
|
||||
var checkedCompareBoxes = new Object();
|
||||
|
|
@ -92,12 +92,12 @@ YAHOO.util.Event.addListener(window, "load", function() {
|
|||
checkedCompareBoxes[compareCheckBoxes[i].value] = true;
|
||||
}
|
||||
}
|
||||
if (checked > 1 && checked < maxComparisons){
|
||||
btnCompare.set("disabled",false);
|
||||
btnCompare2.set("disabled",false);
|
||||
if (checked < 2){
|
||||
alert(tooFewMessage);
|
||||
}else if (checked > maxComparisons){
|
||||
alert(tooManyMessage);
|
||||
}else{
|
||||
btnCompare.set("disabled",true);
|
||||
btnCompare2.set("disabled",true);
|
||||
window.document.forms['doCompare'].submit();
|
||||
}
|
||||
var elements = window.compareDataTable.getRecordSet().getRecords();
|
||||
for(j=0; j<elements.length; j++){
|
||||
|
|
@ -109,21 +109,17 @@ YAHOO.util.Event.addListener(window, "load", function() {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(document.getElementById("compare")){
|
||||
var btnCompare = new YAHOO.widget.Button("compare",{disabled:true,id:"compareButton"});
|
||||
btnCompare.on("click", function(e) {
|
||||
window.document.forms['doCompare'].submit();
|
||||
},this,true);
|
||||
var btnCompare = new YAHOO.widget.Button("compare",{id:"compareButton"});
|
||||
btnCompare.on("click", compareFormButton);
|
||||
}
|
||||
|
||||
if(document.getElementById("compare2")){
|
||||
var btnCompare2 = new YAHOO.widget.Button("compare2",{disabled:true,id:"compareButton2"});
|
||||
btnCompare2.on("click", function(e) {
|
||||
window.document.forms['doCompare'].submit();
|
||||
},this,true);
|
||||
var btnCompare2 = new YAHOO.widget.Button("compare2",{id:"compareButton2"});
|
||||
btnCompare2.on("click", compareFormButton);
|
||||
}
|
||||
|
||||
|
||||
if(document.getElementById("search")){
|
||||
var btnSearch = new YAHOO.widget.Button("search");
|
||||
btnSearch.on("click", function(e) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue