-Checkbox template: <br>
+<div>Checkboxes</div>
<label>
- <input type="checkbox"
- name="{$component.id}"/>
+ <input type="checkbox" name="{$component.id}" class="glm-admin-search-field"/>
<span>{$component.displayName}</span>
</label>
-<script>
- if ( localStorage.getItem("{$component.id}") ) {
- console.log("yeah on {$component.id}");
- // ${'[name="{$component.id}"]'}.attr("checked", true);
- } else {
- console.log("no localstorage item for {$component.id}");
- }
-</script>
\ No newline at end of file
+<script></script>
{foreach $searchFields.components as $component}
{if isset($component.template)}
-
+
{if "{$smarty.current_dir}/../components/{$component.template}.html"|is_file}
{include file="../components/{$component.template}.html"}
{else}
Failed loading {$smarty.current_dir}/../components/{$component.template}.html
{/if}
+
{/if}
- <br>
+
{/foreach}
</div>
<div id="glm-admin-member-list" class="row admin-member-list">
</div>
</div>
<script>
+
jQuery(function($){
- let searchResults = {};
- let imageUrl = `{$glmPluginMediaUrl}/images`
- let data = {
- action : 'glm_members_admin_ajax',
- glm_action : 'adminSearch',
- // table : textSearchData.table,
- // fields : textSearchData.fields,
- // where : textSearchData.where
+ window.Glma = {
+ adminSearch: function(data){
+ $.ajax({
+ dataType: "json",
+ type : 'POST',
+ url: '{$ajaxUrl}',
+ data: data,
+ complete: $("#glm-admin-search-overlay").fadeOut('slow'),
+ success: function(data) {
+ data.searchData.forEach( function(value, index){
+ $("<div />", {
+ text : value,
+ class : "glm-list-result"
+ }).appendTo( $("#glm-admin-member-list"));
+ })
+ }
+ });
}
-
- $.ajax({
- dataType: "json",
- type : 'POST',
- url: '{$ajaxUrl}',
- data: data,
- complete: $("#glm-admin-search-overlay").fadeOut('slow'),
- success: function(data) {
- data.searchData.forEach( function(value, index){
- $("<div />", {
- text : value,
- class : "glm-list-result"
- }).appendTo( $("#glm-admin-member-list"));
- })
- }
- });
- });
-</script>
-
-
+ };
-<script>
/*
* Init Materialize collapsible
});
}
+
+
+
+
+ let data = {
+ action : 'glm_members_admin_ajax',
+ glm_action : 'adminSearch',
+ // table : textSearchData.table,
+ // fields : textSearchData.fields,
+ // where : textSearchData.where
+ }
+ window.Glma.adminSearch(data);
+
+ $(".glm-admin-search-field").on("change", function(){
+ console.log( $(this) );
+ window.Glma.adminSearch(data);
+ })
+});
</script>
{include file='admin/footer.html'}
\ No newline at end of file