[Cartoweb-users] problems with the plugin search

Claire Chastagnol chastagnol.claire at wanadoo.fr
Thu Jul 31 03:20:45 EDT 2008


Hi everybody,

I have a new problem with an other plugin : the plugin search!!

I have loaded the plugin on the server and on the client side. I have edited the search.ini file, the search.tpl, the search_results.tpl and the search.ajax.js, like in the documentation. I have also modified the cartoclient.tpl.
The "search" button appears in my page with the field to search in, but nothing happens when I click on the button.

What could be the problem? It seems the .js file is doing nothing, is there a problem in it??

Here are some extracts of my files:

search.tpl:

...
<p>
  <input type="submit" value="{t}Search{/t}" class="form_button"
           onclick="javascript: CartoWeb.trigger('Search.DoIt'); return false;"/>
     
  <input type="hidden" id="search_config" name="search_config" value="evenements"/>
  <input type="hidden" id="search_sort_column" name="search_sort_column" value="type_ev" />
  <input type="hidden" id="search_sort_direction" name="search_sort_direction" value="asc" />
  <input type="hidden" id="search_number" name="search_number" />
  <input type="hidden" id="search_page" name="search_page" />
 
 <div id="search_results_div"></div>
</p>
...

Search.ajax.je:
AjaxPlugins.Search = {
  
    handleResponse: function(pluginOutput) {
        
        if (pluginOutput.htmlCode.evenements)
            $('search_results_div').innerHTML = pluginOutput.htmlCode.evenements;
    }  
};

/*
 * Search plugin's Actions
 */
 
AjaxPlugins.Search.Actions = {};
AjaxPlugins.Search.Actions.DoIt = {
    buildPostRequest: function(argObject) {
        return AjaxHandler.buildPostRequest();
    }
};
function order(column) {
    
    
    if (column != $('search_sort_column').value) {
        $('search_sort.column').value = column;
  $('search_sort.direction').value = 'asc';
    } else {
  if $('search_sort.direction').value == 'asc'{
  $('search_sort.direction').value == 'desc';
  } else {
   $('search_sort.direction').value = 'asc';
   }
  }
  
    CartoWeb.trigger('Search.DoIt');
}


function recenter(id) {
 if ($('search_config').value == 'evenements'{
 
  $('id_recenter_ids').value = gid;
  $('id_recenter_layer').value = $('search_config').value; 
    
    
    CartoWeb.trigger('Location.Recenter');
 }
}
    function search(config) {
    
    $('search_config').value = config;
    if (config == 'evenements') {
        $('search_number').value = 10;
    }
    
    CartoWeb.trigger('Search.DoIt');
 }
 

Thank you!!!!!!
Claire
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/cartoweb-users/attachments/20080731/29ba5800/attachment.html


More information about the Cartoweb-users mailing list