testing jquery results from array in the new member management dashboard
authorAnthony Talarico <talarico@gaslightmedia.com>
Thu, 25 Oct 2018 12:35:01 +0000 (08:35 -0400)
committerAnthony Talarico <talarico@gaslightmedia.com>
Thu, 25 Oct 2018 12:35:01 +0000 (08:35 -0400)
models/admin/ajax/adminSearch.php
setup/adminHooks.php
setup/adminMenus.php
views/admin/manageMembers/manage.html

index dc6b057..a8c1391 100644 (file)
@@ -79,7 +79,7 @@ class GlmMembersAdmin_ajax_adminSearch
         }
         
         $return = array(
-            'searchData'    => 'test'        // Where our events list will go
+            'searchData'    => ['result 1','result 2','result 3','result 4','result 5']        // Where our events list will go
         );
 
         header('Content-type:application/json;charset=utf-8', true);
index edbbd04..089f1a4 100644 (file)
@@ -108,8 +108,7 @@ if( !$menuExists && defined( 'GLM_MEMBERS_PLUGIN_MEMBERS_ONLY_ID' ) ){
 }
 
 $locations = get_theme_mod( 'nav_menu_locations' );
-if(!empty($locations))
-{
+if(!empty($locations)){
     $menu = get_term_by('name', $menuName, 'nav_menu');
     $locations[$menuSlug] = $menu->term_id;
     set_theme_mod('nav_menu_locations', $locations);
index 87443ca..a0ca7e4 100644 (file)
@@ -75,7 +75,7 @@ if (current_user_can('glm_members_members')) {
         add_submenu_page(
             $mainMenuSlug,
             $this->config['terms']['term_admin_menu_members'].' Members',
-            $this->config['terms']['term_admin_menu_newMembers'],
+            $this->config['terms']['term_admin_menu_members'],
             'glm_members_member',
             'glm-members-admin-menu-members',
             function() {$this->controller('members', 'index');}
index d4f17f3..1aaca43 100644 (file)
@@ -4,9 +4,14 @@
         width: 100%;
         height: 100vh;
     }
+    .glm-list-result{
+        background-color: #FFFFFF;
+        padding: 5px;
+        border-bottom: 1px solid #DEE2E2;
+    }
 </style>
 <div class="glm-dashboard-background">
-    test
+    <div id="glm-admin-member-list" class="row admin-member-list"></div>
 </div>
 <script>
     jQuery(function($){
                 // fields      : textSearchData.fields,
                 // where       : textSearchData.where
             }
-   
+            
             $.ajax({
                 dataType: "json",
                 type : 'POST',
                 url: '{$ajaxUrl}',
                 data: data,
                 success: function(data) {
-       
+                    data.searchData.forEach( function(){
+                        $("<div />", {
+                            text    : data.searchData,
+                            class   : "glm-list-result"
+                        }).appendTo( $("#glm-admin-member-list")).delay(2000).addClass("test") ;
+                    })
                 }
             });
         });