Changeset 1598 for trunk/contactcenter/js/cc_search.js
- Timestamp:
- 11/06/09 09:50:22 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/contactcenter/js/cc_search.js
r285 r1598 27 27 this.onClose = null; 28 28 this.onOpen = null; 29 30 29 this.DOMholder = params['holder']; 31 30 this.DOMdiv = document.createElement('div'); … … 33 32 this.DOMinput = document.createElement('input'); 34 33 this.DOMbtn = document.createElement('input'); 34 this.DOMbtn2 = document.createElement('input'); 35 this.DOMbtn3 = document.createElement('input'); 36 this.DOMinputx = document.createElement('input'); 35 37 this.DOMprogHold = document.createElement('div'); 36 38 this.DOMresult = document.createElement('div'); … … 59 61 this.DOMinput.type = 'text'; 60 62 this.DOMinput.value = params['value'] ? params['value'] : ''; 63 this.DOMinput.id = 'DOMinput'; 61 64 this.DOMinput.style.width = params['input_width'] ? params['input_width'] : '200px'; 62 65 this.DOMinput.onkeypress = function (e) { … … 70 73 } 71 74 }; 75 76 this.DOMinputx.type = 'text'; 77 this.DOMinputx.value = params['value'] ? params['value'] : ''; 78 this.DOMinputx.id = 'DOMinputx'; 79 this.DOMinputx.style.width = '100px'; 80 this.DOMinputx.onkeypress = function (e) { 81 if (is_ie) 82 { 83 if (window.event.keyCode == 13) _this.go(); 84 } 85 else 86 { 87 if (e.which == 13) _this.go(); 88 } 89 }; 90 72 91 //this.DOMinput.style.height = parseInt(this.DOMdiv.style.height)/2 + 'px'; 73 92 … … 78 97 this.DOMbtn.onclick = function () {_this.go();}; 79 98 99 this.DOMbtn2.type = 'button'; 100 //this.DOMbtn2.style.height = parseInt(this.DOMdiv.style.height)/2 + 'px'; 101 this.DOMbtn2.style.width = '60px'; 102 this.DOMbtn2.value = 'Nome:'; 103 104 this.DOMbtn3.type = 'button'; 105 //this.DOMbtn3.style.height = parseInt(this.DOMdiv.style.height)/2 + 'px'; 106 this.DOMbtn3.style.width = '60px'; 107 this.DOMbtn3.value = v_label; 80 108 this.DOMprogHold.style.position = 'absolute'; 81 109 this.DOMprogHold.style.top = params['progress_top'] ? params['progress_top'] : '0px'; … … 98 126 this.DOMholder.appendChild(this.DOMdiv); 99 127 this.DOMdiv.appendChild(this.DOMfields); 128 this.DOMdiv.appendChild(this.DOMbtn2); 100 129 this.DOMdiv.appendChild(this.DOMinput); 130 if(v_label != false & v_atrib != false) 131 { 132 this.DOMdiv.appendChild(this.DOMbtn3) 133 this.DOMdiv.appendChild(this.DOMinputx); 134 } 101 135 this.DOMdiv.appendChild(spacer); 102 136 this.DOMdiv.appendChild(this.DOMbtn); … … 126 160 127 161 data['search_for'] = this.DOMinput.value; 162 data['search_for_area'] = this.DOMinputx.value; 163 128 164 var search_for = data['search_for'].split(' '); 129 165 var greaterThan4 = false; 166 var use_length = v_min; 167 168 if (search_for.length == 1) 169 { 170 if(search_for[0].length == 0) 171 { 172 search_for[0] = "*"; 173 data['search_for'] = "*"; 174 use_length = 1; 175 } 176 } 130 177 131 178 for (i = 0; i < search_for.length; i++) 132 179 { 133 if (search_for[i].length >= 4)180 if (search_for[i].length >= use_length) 134 181 { 135 182 greaterThan4 = true; … … 138 185 139 186 if (!greaterThan4){ 140 alert("Favor fazer a consulta com pelo menos 4caracteres!");187 alert("Favor fazer a consulta com pelo menos " + v_min + " caracteres!"); 141 188 return; 142 189 } … … 240 287 } 241 288 }; 242 243 289 290 this.Connector.newRequest('search', CC_url+'search&data='+serialize(data), 'GET', handler); 244 291 }
Note: See TracChangeset
for help on using the changeset viewer.