//条码录入,自动完成功能function addAutoComplete() { $('#txt_spuNo').autocomplete({ autoFocus: true, source: function (request, response) { $.ajax({ url: "../HandlerBase.ashx?action=TipBarcode", data: { spu: request.term }, success: function (data) { response($.parseJSON(data)); } }); }, minLength: 3
});}
自定义格式:
SKU: 批次: 版号:
后台:
using System.Runtime.Serialization;namespace JQueryUIApp.Model{ [DataContract] public class FlowcardModel { [DataMember] public string SKU { get; set; } [DataMember] public string BatchNo { get; set; } [DataMember] public string GroupNo { get; set; } }}
using System.Collections.Generic;using System.Web.Http;using JQueryUIApp.Model;namespace JQueryUIApp.Service.Controllers{ public class FlowCardController : ApiController { public ListGetList() { var list = new List (); list.Add(new FlowcardModel() { SKU = "12300000", BatchNo = "P01", GroupNo = "1" }); list.Add(new FlowcardModel() { SKU = "12340000", BatchNo = "P01", GroupNo = "1" }); list.Add(new FlowcardModel() { SKU = "12345000", BatchNo = "P01", GroupNo = "1" }); return list; } }}