Subversion Repositories SmartDukaan

Rev

Rev 25144 | Rev 25649 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 25144 Rev 25394
Line 541... Line 541...
541
		},
541
		},
542
		autoSelect : true,
542
		autoSelect : true,
543
		afterSelect : callback
543
		afterSelect : callback
544
	});
544
	});
545
}
545
}
-
 
546
function getEntityAheadOptions(jqElement, callback) {
-
 
547
	jqElement.typeahead('destroy').typeahead({
-
 
548
		source : function(q, process) {
-
 
549
			if (q.length >= 3) {
-
 
550
				return $.ajax(context + "/entity", {
-
 
551
					global : false,
-
 
552
					data : {
-
 
553
						query : q
-
 
554
					},
-
 
555
					success : function(data) {
-
 
556
						queryData = JSON.parse(data);
-
 
557
						process(queryData);
-
 
558
					},
-
 
559
				});
-
 
560
			}
-
 
561
		},
-
 
562
		delay : 400,
-
 
563
		items : 20,
-
 
564
		displayText : function(entity) {
-
 
565
			return entity.title_s + "(" + entity.catalogId_i + ")";
-
 
566
		},
-
 
567
		autoSelect : true,
-
 
568
		afterSelect : callback
-
 
569
	});
-
 
570
}
546
function getPartnerAheadOptions(jqElement, callback) {
571
function getPartnerAheadOptions(jqElement, callback) {
547
	jqElement.typeahead('destroy').typeahead({
572
	jqElement.typeahead('destroy').typeahead({
548
		source : function(q, process) {
573
		source : function(q, process) {
549
			if (q.length >= 3) {
574
			if (q.length >= 3) {
550
				return $.ajax(context + "/partners", {
575
				return $.ajax(context + "/partners", {