From 5059c69e1493b7f36e47f87539626a9c40fc6692 Mon Sep 17 00:00:00 2001 From: Abdul Manan Date: Fri, 15 Nov 2024 19:55:43 +0500 Subject: [PATCH] Fixed coupon search functionality --- ecommerce/static/js/views/coupon_list_view.js | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/ecommerce/static/js/views/coupon_list_view.js b/ecommerce/static/js/views/coupon_list_view.js index 6d3e76ff8b3..826a409ecc5 100644 --- a/ecommerce/static/js/views/coupon_list_view.js +++ b/ecommerce/static/js/views/coupon_list_view.js @@ -82,7 +82,6 @@ define([ if (!$.fn.dataTable.isDataTable('#couponTable')) { couponTable = this.$el.find('#couponTable').DataTable({ - serverSide: true, ajax: this.url, autoWidth: false, lengthMenu: [10, 25, 50, 100], @@ -90,16 +89,8 @@ define([ paging: true, initComplete: function() { $('#couponTable_filter input').unbind() - .bind('keyup', function(e) { - // If the length is 3 or more characters, or the user pressed ENTER, search - if (this.value.length >= 3 || e.keyCode === 13) { - couponTable.search(this.value).draw(); - } - - // Ensure we clear the search if they backspace far enough - if (this.value === '') { - couponTable.search('').draw(); - } + .bind('keyup', function() { + couponTable.search(this.value).draw(); }); }, oLanguage: {