Search code examples
javascriptjqueryjquery-pluginsjquery-tokeninput

tokenInput : how to pass additional parameter with queryParam


I am using Jquery Token Input. I need to know, how to pass additional parameter with queryParam.

Script :

$("#demo-input").tokenInput("/MaterialService/GetMaterials",
{
    queryParam: 'q',
    tokenLimit: 1,
});

Controller:

[HttpGet]
public IQueryable<Property> GetMaterials(string q, String type)
{
    //Code for the function
}

I need to access the function 'GetMaterials' in Service Controller. Where In my script, I have have queryParam (i.e. 'q') and another parameter 'type'

while calling the service controller, how i need to pass the 'type' parameter along with the queryParam

Can anyone help?

Thanks in Advance :)


Solution

  • You could try this and feedback results:

    $("#demo-input").tokenInput("/MaterialService/GetMaterials?queryParam=q" + "&type=qq",
                    { tokenLimit: 1, });