jquery tokeninput filter query send extra parameters

后端 未结 5 851
刺人心
刺人心 2020-12-21 00:51

How can I set extra parameters to the query like

q=myseed&filter=1,2,34

better will be with a attached event like

onFoc         


        
5条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-21 01:39

    This is possible by the plugin's native functionality(at least with the current version), it is just not written in the documentation: there is onSend callback in the code. Here is simple example

    $(".my-input").tokenInput('autocomplete.php', {
        hintText: false,
        onSend: function(param1) {
            // console.log($(this));
            // console.log(param1);
            param1.data.my_key = 'my_value';
        }
    });
    

提交回复
热议问题