adding test ajax code for the search filtering, currently commented out
authorAnthony Talarico <talarico@gaslightmedia.com>
Tue, 11 Apr 2017 18:22:57 +0000 (14:22 -0400)
committerAnthony Talarico <talarico@gaslightmedia.com>
Tue, 11 Apr 2017 18:22:57 +0000 (14:22 -0400)
glm-member-db/views/front/members/list.html

index 22ebc5c..bc24e44 100644 (file)
             $(this).css("display", "block");
 
         });
-
-
+//         var cat_ids     = [];
+//        $.fn.manufacturer_brand = function(){
+//            
+//            $(this).on("change", function(){
+//                var _ = $(this);
+//                
+//                var cat_names   = [];
+//                var cat_id      = _.val();
+//                var el_id       = _.attr('id');
+//                var cats        = _.prev().find('span');
+//                
+//                cat_ids.push(cat_id);
+//           
+//                cats.each(function(){
+//                    cat_names.push(_.text());
+//                });
+//                
+//                var data = {
+//                  action: 'glm_members_admin_ajax',
+//                  glm_action: 'filterSearch',
+//                  cat_ids: cat_ids,
+//                  el_id: el_id,
+//                  cat_names: cat_names,
+//                };
+//                $.ajax({
+//                  type: 'POST',
+//                  url: '{$ajaxUrl}',
+//                  data: data,
+//                  success: function(response){
+//                      console.log(response);
+//                  }
+//                });
+//                
+//            });
+//        }
+//        $('#rvManufacturers').manufacturer_brand();
+//        $('#brands').manufacturer_brand();
+            
             jQuery('select[multiple]').asmSelect();
 
             // Show search filters box