materiobaseajax module
first ajax geed results + 2 different custom autocomplete func (not used for now) - deselect - searchapi Signed-off-by: bachy <git@g-u-i.net>
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
// @codekit-prepend "gui.js"
|
||||
(function($) {
|
||||
|
||||
$('#search-api-page-search-form-grid').bind('submit', function(event) {
|
||||
trace('search submited', event);
|
||||
var keys = $(this).find('input[name*="keys"]').val(),
|
||||
id = $(this).find('input[name="id"]').val();
|
||||
trace('keys', keys);
|
||||
trace('form_id', id);
|
||||
|
||||
$.getJSON('/materiobaseajax/search/'+id+'/'+keys,
|
||||
// {form_id: "theform_id", keys: "thekeys"},
|
||||
function(json){
|
||||
trace('json', json);
|
||||
if(json.return){
|
||||
$('#content').html(json.return);
|
||||
}
|
||||
});
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
// select event need a patch http://drupal.org/node/365241#comment-5374686
|
||||
|
||||
// $("input.form-text", '#search-api-page-search-form-grid').bind('autocomplete_select', function(event) {
|
||||
// trace('val', $(this).val());
|
||||
// var $form = $(this).parent('form');
|
||||
// // setTimeout(function(){
|
||||
// // $form.submit();
|
||||
// // }, 10);
|
||||
// });
|
||||
|
||||
function navigate(){
|
||||
|
||||
};
|
||||
|
||||
})(jQuery);
|
||||
Reference in New Issue
Block a user