我遵循这个示例来创建一个附在文本字段上的建议控件:
webix.ui({
view: "suggest",
input: $$("testText"),
body:{
dataFeed:"/data.php"
}
});datafeed属性将请求发送到服务器并返回筛选过的数据。请求是
"data.php?filter[value]=Ar" // where 'Ar' is a typed text但是,如果我需要限制发送请求所需的最小类型符号数量,该怎么办?例如,当输入超过3个字符时,我希望重新加载数据。
这是可能的还是我需要写我自己的方法?怎么做?
提前谢谢你的提示。
发布于 2016-12-15 08:09:55
这似乎并不简单,我在webix论坛上找到了这个解决方案:
body:{
dataFeed: function(filtervalue){
if(filtervalue.length<3) return;
var urldata = "filter[value]="+encodeURIComponent(filtervalue);
this.load("http://docs.webix.com/samples/13_form/01_controls/server/data.php?"+urldata, this.config.datatype);
}
}演示片段:http://webix.com/snippet/4019c87a
https://stackoverflow.com/questions/41140236
复制相似问题