日期:2014-05-16 浏览次数:20356 次
/*这是一个测试用数据,其中第一条数据包含一个子对象,这个子对象刚好也有个name属性 */ var mockData = [{ "name":"fOO", "id":1, "innerObj":{"name":"张三","id":1} },{ "name":"bar", "id":2}]; var mockService = function(query){ var d = new dojo.Deferred(); d.fullLength = mockData.length; d.callback(mockData); return d; }; var myJsonRestStore = new dojox.data.JsonRestStore({ target: "some/url", service : mockService, });
<input dojoType="dijit.form.ComboBox" store="myJsonRestStore" searchAttr="name"></input>