1

I am trying to change the request param (query) for magicsuggest to my custom tag, have tried passing function in data with my own ajax call, trying to set my custom tag with request.query. is there any other way to do this? to manipulate the 'dataUrlParams' somehow

_mSuggest=$("#inpsuggest").magicSuggest({

    //dataUrlParams: jsonUrlParamObj,   
    displayField: 'fullname',
    //data: myUrlToPost,
    data: function (request,response) {
        $.ajax({
            type: 'POST',
            url: myUrlToPost,
            dataType: 'json',
            data: {**searchStr**:request.query},
            success: function (data) {                  
                response(data);
            }
        });
    },
    maxSelection:1,
    typeDelay:400
});
4

1 回答 1

3

解决了,

_mSuggest=$("#inpsuggest").magicSuggest({

    //dataUrlParams: jsonUrlParamObj,   
    displayField: 'fullname',
    //data: myUrlToPost,
    data: function (request,response) {
        $.ajax({
            type: 'POST',
            url: myUrlToPost,
            dataType: 'json',
            data: {**searchStr**:**this.input.val()**},
            success: function (data) {                  
                response(data);
            }
        });
    },
    maxSelection:1,
    typeDelay:400
});
于 2013-10-25T15:15:14.973 回答