设置自动宽度-jQuery自动完成

设置自动宽度-jQuery自动完成,jquery,autocomplete,Jquery,Autocomplete,如何在jQuery自动完成选项中设置自动宽度 $('#'+pmId).autocomplete('mst_get_masterinfo.php?vValid=15&vRetType=1&vCategory='+vCatCode,{ delay:10, cacheLength: 0, width:200,// Width Option mustMatch:true, }); 我曾经使用open选项来执行此操作,该选项在菜单打开后触发

如何在jQuery自动完成选项中设置自动宽度

$('#'+pmId).autocomplete('mst_get_masterinfo.php?vValid=15&vRetType=1&vCategory='+vCatCode,{
      delay:10,
      cacheLength: 0,
      width:200,// Width Option
      mustMatch:true,
});

我曾经使用
open
选项来执行此操作,该选项在菜单打开后触发

$('#'+pmId).autocomplete('mst_get_masterinfo.php?vValid=15&vRetType=1&vCategory='+vCatCode,{
    delay:10,
    cacheLength: 0,
    mustMatch:true,
    open: function() { 
        // After menu has been opened, set width to 100px
        $('.ui-menu')
            .width(100);
    }  
});

嗨,我只想在每一行显示我的自动建议结果。根据结果,宽度将自动增加。我不想直接给出宽度选项。。建议我最后我修改了jquery.autocomplete.js文件并设置了宽度:autodidnotget,抱歉。您的意思是自动调整
ui菜单的大小吗?如果是,请使用
$('.ui菜单').width('auto')
open
回调中。在open调用中无法正常工作,因此我修改了主autocomplete.js文件并设置了宽度directlywidth:typeof options.width==“string”| | options.width>0?options.width:“自动”,