jQuery UI Autocomplete disable Select & Close events

前端 未结 5 1933
离开以前
离开以前 2020-12-06 10:33

I\'m using jQuery UI\'s Autocomplete slightly differently than it was probably created to do.

Basically I want to keep all the same functionality, the only differenc

5条回答
  •  隐瞒了意图╮
    2020-12-06 10:49

    I tried the various ideas others have presented here without success.

    I am using Jquery 2.1.4 with UI 1.11.4 and this is how I got this to work:

    Javascript:

    
      
    

    CSS:

    
    
    

    Backend Source "lookup_processor.php":

    
    $data['id'], 
                'label'=>$data['label'], 
                'value'=>$data['value'], 
                'selectable'=>$data['some_thing_to_check']>0?true:false, // This is the parameter our 'select:' function is looking for
                'send_it_all_if_you_want'=>json_encode($data)); // this is just an example of how you can send back anything you want 
             );
         }
    
        // send the results back to autocomplete
        echo json_encode($search_results);
        exit;
    
    ?>
    

提交回复
热议问题