关于autoComplete 的source的设置
刚工作,因需求要用到autoComplete。
看到它的选项source的配置。
Type: Array or String or Function( Object request, Function response( Object data ) )
Default: none; must be specified
Array: An array can be used for local data. There are two supported formats:
An array of strings: [ "Choice1", "Choice2" ]
An array of objects with label and value properties: [ { label: "Choice1", value: "value1" }, ... ]
我主要想source从数据库中获得数据,并返回第二数组类型 [ { label: "Choice1", value: "value1" }, ... ]
感觉没有头绪。哪位大神能简单实现代码让我观摩一下。
就是source:XXXXXX.jsp
XXXXX.jsp里面怎么写。如何从数据库中得到值可以省略,我想看到从数据库中得到值之后,怎么处理并返回给source的。
谢谢大家了