Created
August 8, 2016 18:31
-
-
Save soifou/eba4b6a632f57fc53c924686778ae6a7 to your computer and use it in GitHub Desktop.
Transform all Adminer selects into select2 (for filtering)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class AdminerSelect2 | |
{ | |
function head() { | |
?> | |
<link href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.3/css/select2.min.css" rel="stylesheet" /> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.3/js/select2.min.js"></script> | |
<script> | |
jQuery(document).ready(function($) { | |
initSelect2(); | |
jQuery('legend a').on('click', function(e) { | |
initSelect2(); | |
}); | |
}); | |
function initSelect2() { jQuery('select').select2(); } | |
</script> | |
<?php | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Wow did not remember of this gist :]
Actually this is a "plugin" for adminer that you need to setup like any other plugins, here the doc in case you missed it.
You can browse my custom adminer repository if you want a concrete example, and there is the call for this plugin.
Good luck!