中止select2上的errorLoading消息

时间:2018-04-05 13:41:49

标签: jquery-select2

看起来当你在具有ajax行为的下拉列表中中止查询时,errorLaoding('结果无法加载。')显示在结果选项上。

我在代码中挖了一下,我发现该消息是由自34.6 rc1以来的3476行(版本4.0.3)修复触发的

cols = ['col1', 'col2']
df2.set_index(cols).combine_first(
    df1.set_index(cols)
).reset_index().astype(df1.dtypes)

      col1 col2  col3
0    hello    q     2
1    hello    t     4
2  welcome    r     3
3    world    q     2

但是上面的中止测试没有阻止

self.trigger('results:message', {
    message: 'errorLoading'
});

因为中止状态(jQuery 3.3.1第9028行)不是一个字符串而是一个整数和$ request.status是不够的,所以我们可以用它来纠正这个问题吗?

// Attempt to detect if a request was aborted
// Only works if the transport exposes a status property
if ($request.status && $request.status === '0') {
      return;
}

0 个答案:

没有答案