Subversion Repositories SmartDukaan

Rev

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

Rev 28569 Rev 28795
Line 680... Line 680...
680
		},
680
		},
681
		autoSelect: true,
681
		autoSelect: true,
682
		afterSelect: callback
682
		afterSelect: callback
683
	});
683
	});
684
}
684
}
-
 
685
 
-
 
686
 
-
 
687
function getImeiAheadOptions(jqElement, fofoId, callback) {
-
 
688
	jqElement.typeahead('destroy').typeahead({
-
 
689
		source: function(q, process) {
-
 
690
			if (q.length >= 3) {
-
 
691
				return $.ajax(context + "/imei?fofoId=" + fofoId, {
-
 
692
					global: false,
-
 
693
					data: {
-
 
694
						query: q
-
 
695
					},
-
 
696
					success: function(data) {
-
 
697
						queryData = JSON.parse(data);
-
 
698
						process(queryData);
-
 
699
					},
-
 
700
				});
-
 
701
			}
-
 
702
		},
-
 
703
		delay: 300,
-
 
704
		items: 20,
-
 
705
		displayText: function(imei) {
-
 
706
			return imei;
-
 
707
		},
-
 
708
		autoSelect: true,
-
 
709
		afterSelect: callback
-
 
710
	});
-
 
711
}
-
 
712
 
-
 
713
 
-
 
714
 
685
function getEntityAheadOptions(jqElement, callback) {
715
function getEntityAheadOptions(jqElement, callback) {
686
	jqElement.typeahead('destroy').typeahead({
716
	jqElement.typeahead('destroy').typeahead({
687
		source: function(q, process) {
717
		source: function(q, process) {
688
			if (q.length >= 3) {
718
			if (q.length >= 3) {
689
				return $.ajax(context + "/entity", {
719
				return $.ajax(context + "/entity", {
Line 760... Line 790...
760
	if (messageType == null) {
790
	if (messageType == null) {
761
		messageQueryString = "";
791
		messageQueryString = "";
762
	}
792
	}
763
	doGetAjaxRequestHandler(context + "/notifications" + messageQueryString, function(response) {
793
	doGetAjaxRequestHandler(context + "/notifications" + messageQueryString, function(response) {
764
		if ($container != null) {
794
		if ($container != null) {
765
			loaderDialogObj.one('hidden.bs.modal', function(){
795
			loaderDialogObj.one('hidden.bs.modal', function() {
766
				$container.popover({
796
				$container.popover({
767
					container: $container,
797
					container: $container,
768
					template: '<div class="popover popover1" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content popover2"></div></div>',
798
					template: '<div class="popover popover1" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content popover2"></div></div>',
769
					content: response,
799
					content: response,
770
					html: true,
800
					html: true,
Line 787... Line 817...
787
		documentName);
817
		documentName);
788
}
818
}
789
 
819
 
790
 
820
 
791
/* Create an array with the values of all the input boxes in a column */
821
/* Create an array with the values of all the input boxes in a column */
792
$.fn.dataTable.ext.order['dom-text'] = function  ( settings, col )
822
$.fn.dataTable.ext.order['dom-text'] = function(settings, col) {
793
{
-
 
794
    return this.api().column( col, {order:'index'} ).nodes().map( function ( td, i ) {
823
	return this.api().column(col, { order: 'index' }).nodes().map(function(td, i) {
795
        return $('input', td).val();
824
		return $('input', td).val();
796
    } );
825
	});
797
}
826
}
798
 
827
 
799
/* Create an array with the values of all the input boxes in a column, parsed as numbers */
828
/* Create an array with the values of all the input boxes in a column, parsed as numbers */
800
$.fn.dataTable.ext.order['dom-text-numeric'] = function  ( settings, col )
829
$.fn.dataTable.ext.order['dom-text-numeric'] = function(settings, col) {
801
{
-
 
802
    return this.api().column( col, {order:'index'} ).nodes().map( function ( td, i ) {
830
	return this.api().column(col, { order: 'index' }).nodes().map(function(td, i) {
803
        return $('input', td).val() * 1;
831
		return $('input', td).val() * 1;
804
    } );
832
	});
805
}
833
}
806
 
834
 
807
/* Create an array with the values of all the select options in a column */
835
/* Create an array with the values of all the select options in a column */
808
$.fn.dataTable.ext.order['dom-select'] = function  ( settings, col )
836
$.fn.dataTable.ext.order['dom-select'] = function(settings, col) {
809
{
-
 
810
    return this.api().column( col, {order:'index'} ).nodes().map( function ( td, i ) {
837
	return this.api().column(col, { order: 'index' }).nodes().map(function(td, i) {
811
        return $('select', td).val();
838
		return $('select', td).val();
812
    } );
839
	});
813
}
840
}
814
 
841
 
815
/* Create an array with the values of all the checkboxes in a column */
842
/* Create an array with the values of all the checkboxes in a column */
816
$.fn.dataTable.ext.order['dom-checkbox'] = function  ( settings, col )
843
$.fn.dataTable.ext.order['dom-checkbox'] = function(settings, col) {
817
{
-
 
818
    return this.api().column( col, {order:'index'} ).nodes().map( function ( td, i ) {
844
	return this.api().column(col, { order: 'index' }).nodes().map(function(td, i) {
819
        return $('input', td).prop('checked') ? '1' : '0';
845
		return $('input', td).prop('checked') ? '1' : '0';
820
    } );
846
	});
821
}
847
}
822
848