Subversion Repositories SmartDukaan

Rev

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

Rev 36572 Rev 36598
Line 1026... Line 1026...
1026
        autoSelect: true,
1026
        autoSelect: true,
1027
        afterSelect: callback
1027
        afterSelect: callback
1028
    });
1028
    });
1029
}
1029
}
1030
 
1030
 
-
 
1031
function getCatalogAheadOptions(jqElement, minPrice, callback) {
-
 
1032
    jqElement.typeahead('destroy').typeahead({
-
 
1033
        source: function (q, process) {
-
 
1034
            if (q.length >= 3) {
-
 
1035
                return $.ajax(context + "/catalogItem?minPrice=" + minPrice, {
-
 
1036
                    global: false,
-
 
1037
                    data: {
-
 
1038
                        query: q
-
 
1039
                    },
-
 
1040
                    headers: {
-
 
1041
                        'IdempotencyKey': IdempotencyKey
-
 
1042
                    },
-
 
1043
                    success: function (data) {
-
 
1044
                        queryData = JSON.parse(data);
-
 
1045
                        process(queryData);
-
 
1046
                    },
-
 
1047
                });
-
 
1048
            }
-
 
1049
        },
-
 
1050
        delay: 300,
-
 
1051
        items: 20,
-
 
1052
        displayText: function (item) {
-
 
1053
            return item.itemDescription;
-
 
1054
        },
-
 
1055
        autoSelect: true,
-
 
1056
        afterSelect: callback
-
 
1057
    });
-
 
1058
}
-
 
1059
 
1031
function loadPriceDrop(domId) {
1060
function loadPriceDrop(domId) {
1032
    doGetAjaxRequestHandler(context + "/getItemDescription",
1061
    doGetAjaxRequestHandler(context + "/getItemDescription",
1033
        function (response) {
1062
        function (response) {
1034
            $('#' + domId).html(response);
1063
            $('#' + domId).html(response);
1035
        });
1064
        });