Added proxying by alternate criteria to WobjectProxy
This commit is contained in:
parent
d7171e5d49
commit
02d24c4e4c
13 changed files with 515 additions and 31 deletions
BIN
www/extras/wobject/WobjectProxy/hline.gif
Normal file
BIN
www/extras/wobject/WobjectProxy/hline.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 848 B |
42
www/extras/wobject/WobjectProxy/querybuilder.css
Normal file
42
www/extras/wobject/WobjectProxy/querybuilder.css
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
.qbtd {
|
||||
height: 20px;
|
||||
background-image: url(/extras/wobject/WobjectProxy/hline.gif);
|
||||
padding-left: 5px;
|
||||
padding-right: 5px;
|
||||
}
|
||||
|
||||
.qbtdleft {
|
||||
height: 20px;
|
||||
background-image: url(/extras/wobject/WobjectProxy/hline.gif);
|
||||
padding-right: 5px;
|
||||
}
|
||||
|
||||
.qbtdright {
|
||||
height: 20px;
|
||||
background-image: url(/extras/wobject/WobjectProxy/vline.gif);
|
||||
background-repeat: repeat-y;
|
||||
align: right;
|
||||
}
|
||||
|
||||
.qbfieldLabel {
|
||||
text-align: left;
|
||||
font-size: 12px;
|
||||
border-style: solid;
|
||||
border-width: 1px;
|
||||
padding-right: 4px;
|
||||
padding-left: 4px;
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
.qbselect {
|
||||
height: 20px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.qbText {
|
||||
background-color: white;
|
||||
text-align: left;
|
||||
font-size: 12px;
|
||||
|
||||
}
|
||||
|
||||
35
www/extras/wobject/WobjectProxy/querybuilder.js
Normal file
35
www/extras/wobject/WobjectProxy/querybuilder.js
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
function addCriteria ( fieldname, opform, valform ) {
|
||||
var form = opform.form;
|
||||
var operator = getValue(opform);
|
||||
var value = getValue(valform);
|
||||
var criteria = form.proxyCriteria.value;
|
||||
var conjunction = "";
|
||||
var re = /^\s*$/;
|
||||
if(! re.test(criteria)) {
|
||||
conjunction = " " + getValue(form.conjunction) + " ";
|
||||
}
|
||||
if(/\s+/.test(fieldname)) {
|
||||
fieldname = '"' + fieldname + '"';
|
||||
}
|
||||
var statement = fieldname + " " + operator + " " + '"' + value + '"';
|
||||
form.proxyCriteria.value = criteria + conjunction + statement;
|
||||
}
|
||||
|
||||
function getValue(sel) {
|
||||
if(sel.type == "text") {
|
||||
return sel.value;
|
||||
}
|
||||
for(i=0;i<sel.length;i++) {
|
||||
if(sel[i].type == "radio") {
|
||||
if(sel[i].checked) {
|
||||
return sel[i].value;
|
||||
}
|
||||
} else {
|
||||
if(sel.options[i].selected) {
|
||||
return sel.options[i].value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
BIN
www/extras/wobject/WobjectProxy/vline.gif
Normal file
BIN
www/extras/wobject/WobjectProxy/vline.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 869 B |
Loading…
Add table
Add a link
Reference in a new issue