The branch, master has been updated
       via  8f2546271cff3a91434cefbc77f9cf56d5e42168 (commit)
      from  3159d9086707b9a84fe706b3a411deec8ce67bf2 (commit)


- Log -----------------------------------------------------------------
commit 8f2546271cff3a91434cefbc77f9cf56d5e42168
Author: Marc Delisle <[email protected]>
Date:   Sun Sep 19 12:28:14 2010 -0400

    display message when search returns zero rows

-----------------------------------------------------------------------

Summary of changes:
 js/tbl_select.js |   21 +++++++++++++++------
 1 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/js/tbl_select.js b/js/tbl_select.js
index 95c60a8..f7bd272 100644
--- a/js/tbl_select.js
+++ b/js/tbl_select.js
@@ -1,3 +1,4 @@
+/* vim: set expandtab sw=4 ts=4 sts=4: */
 /**
  * @fileoverview JavaScript functions used on tbl_select.php
  *
@@ -27,17 +28,25 @@ $(document).ready(function() {
      * @uses    PMA_ajaxShowMessage()
      */
     $("#tbl_search_form").live('submit', function(event) {
+        // jQuery object to reuse
+        $search_form = $(this);
         event.preventDefault();
 
         PMA_ajaxShowMessage(PMA_messages['strSearching']);
 
-       // add this hidden field just once 
-       if (! $(this).find('input:hidden').is('#ajax_request_hidden')) {
-               $(this).append('<input type="hidden" id="ajax_request_hidden" 
name="ajax_request" value="true" />');
-       }
+           // add this hidden field just once 
+           if (! $search_form.find('input:hidden').is('#ajax_request_hidden')) 
{
+               $search_form.append('<input type="hidden" 
id="ajax_request_hidden" name="ajax_request" value="true" />');
+           }
 
-        $.post($(this).attr('action'), $(this).serialize(), function(data) {
-            $("#searchresults").html(data);
+        $.post($search_form.attr('action'), $search_form.serialize(), 
function(response) {
+            if (typeof response == 'string') {
+                // found results
+                $("#searchresults").html(response);
+            } else {
+                // error message (zero rows)
+                $("#searchresults").html(response['message']);
+            }
         })
     })
 }, 'top.frame_content'); // end $(document).ready()


hooks/post-receive
-- 
phpMyAdmin

------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
Phpmyadmin-git mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/phpmyadmin-git

Reply via email to