Przeglądaj źródła

修改来电单位 下拉选择问题

zhangshuangnan 7 lat temu
rodzic
commit
9ce5ce5f2a
1 zmienionych plików z 14 dodań i 15 usunięć
  1. 14 15
      CallCenterWeb.UI/js/comboSelect/jquery.combo.select.js

+ 14 - 15
CallCenterWeb.UI/js/comboSelect/jquery.combo.select.js

@@ -194,7 +194,7 @@
194 194
 			 * Append Input
195 195
 			 */
196 196
 
197
-			this.$input = $('<input placeholder="请选择" type="text"' + (isMobile? 'tabindex="-1"': '') + ' value="'+p+'" class="'+ this.settings.inputClass + '" id="'+ this.$el.attr("id")+'_input">').appendTo(this.$container)
197
+			this.$input = $('<input placeholder="请选择"  type="text"' + (isMobile? 'tabindex="-1"': '') + ' value="'+p+'" class="'+ this.settings.inputClass + '" autocomplete="off" id="'+ this.$el.attr("id")+'_input">').appendTo(this.$container)
198 198
 
199 199
 			/* Update input text */  
200 200
 
@@ -384,7 +384,6 @@
384 384
 				.eq(index)
385 385
 				.addClass(this.settings.hoverClass)
386 386
 
387
-
388 387
 			if(!this.opened) this.$container.trigger('comboselect:open');
389 388
 
390 389
 			this._fixScroll()
@@ -416,10 +415,10 @@
416 415
 			 */
417 416
 			if(typeof index == 'undefined'){
418 417
 				
419
-				index = 0
418
+				index = -1
420 419
 
421 420
 			}
422
-			
421
+
423 422
 			if(this.$el.prop('selectedIndex') != index){
424 423
 
425 424
 				this.$el.prop('selectedIndex', index).trigger('change');
@@ -537,7 +536,7 @@
537 536
 
538 537
 				this.$input.val(text)
539 538
 
540
-			}else{
539
+			}else if(selected=='0'){
541 540
 				this.$input.val('');
542 541
 				this.$input.attr('placeholder',this.$el.find('option').eq(selected).text())
543 542
 			}
@@ -571,7 +570,8 @@
571 570
 			
572 571
 			/* Select the input */
573 572
 			
574
-			this.settings.focusInput && event && event.currentTarget && event.currentTarget.nodeName == 'INPUT' && event.currentTarget.select()
573
+//			this.settings.focusInput && event && event.currentTarget && event.currentTarget.nodeName == 'INPUT' && event.currentTarget.select()
574
+			this.settings.focusInput && event && event.currentTarget && event.currentTarget.nodeName == 'INPUT'
575 575
 		},
576 576
 
577 577
 		_blur: function(){
@@ -584,21 +584,20 @@
584 584
 			
585 585
 			var val = $.trim(this.$input.val().toLowerCase()),
586 586
 				isNumber = !isNaN(val);
587
-			
587
+//				console.log(val) ;
588 588
 			var index = this.$options.filter(function(){
589
-				
590 589
 				if(isNumber){
590
+					
591 591
 					return parseInt($.trim(this.innerHTML).toLowerCase()) == val
592 592
 				}
593
-
594 593
 				return $.trim(this.innerHTML).toLowerCase() == val
595 594
 
596
-			}).prop('index')
597
-		
598
-			/* Select by Index */
599
-						
600
-			this._selectByIndex(index)
601
-			
595
+			}).prop('index');
596
+//			console.log(index);
597
+//			if(index){
598
+				/* Select by Index */
599
+				this._selectByIndex(index)
600
+//			}
602 601
 		},
603 602
 
604 603
 		_change: function(){