var data = combo.getData();
//data是一个数组,你可以增加、删除项,然后
combo.setData(data);作者: johnconner 时间: 2013-1-20 14:13:13
本帖最后由 johnconner 于 2013-1-20 14:15 编辑
niko 发表于 2013-1-20 13:44
var data = combo.getData();
//data是一个数组,你可以增加、删除项,然后
combo.setData(data); ...
还有个问题要请教你,grid.load({id:id},function(){});该方法中回调函数function()能否获取服务器返回的json数据?是不是可以这样获得?function(text){alert(text);}我测试时alert出[object object],不知道如何能获得?
json数据:
{"total":13,"sql":"select top 10 tzid,hrzinfo.name as hrzid,jzid,sbkinds.kind as kindid,gwid,sbweizhi.weizhi as wzid,sbname.sbname as nameid,modelinfo.name as modelid,factoryinfo.name as factoryid,fid,aztime,(nid+CONVERT(VARCHAR(50),random)) as nid from hrzinfo,sbtaizhang,sbweizhi,sbkinds,sbname,modelinfo,factoryinfo where hrzinfo.id=hrzid and sbkinds.id=kindid and sbweizhi.id=wzid and sbname.id=nameid and modelinfo.id=modelid and factoryinfo.id=factoryid and sbtaizhang.del = 1 and hrzid in (1,2)","data":[{"wzid":"回水换热器出口","jzid":1,"aztime":"2008-08-01T00:00:00","factoryid":"上海宜川仪表厂","modelid":"Y-100 0-1.0MPa","hrzid":"染织一厂站","nameid":"压力表","fid":"2235645","kindid":"压力表类","gwid":3,"tzid":1,"nid":"rzyc-1-3-7-180688"},{"wzid":"供水除污器前","jzid":2,"aztime":"2008-08-01T00:00:00","factoryid":"CCS","modelid":"Y-100 0-1.6MPa","hrzid":"染织一厂站","nameid":"温度表","fid":"9985214","kindid":"压力表类","gwid":3,"tzid":2,"nid":"rzyc-2-3-2-180679"},{"wzid":"供水滤污器前","jzid":1,"aztime":"2013-01-14T00:00:00","factoryid":"上海宜川仪表厂","modelid":"Y-100 0-1.0MPa","hrzid":"染织一厂站","nameid":"压力表","fid":"9958","kindid":"压力表类","gwid":1,"tzid":3,"nid":"rzyc-1-1-1-180677"},{"wzid":"供水除污器前","jzid":2,"aztime":"2013-01-15T00:00:00","factoryid":"上海宜川仪表厂","modelid":"Y-100 0-1.0MPa","hrzid":"染织一厂站","nameid":"压力表","fid":"996352","kindid":"压力表类","gwid":3,"tzid":4,"nid":"rzyc-2-3-2-641568"},{"wzid":"供水滤污器前","jzid":2,"aztime":"2013-01-07T00:00:00","factoryid":"上海宜川仪表厂","modelid":"Y-100 0-1.0MPa","hrzid":"染织一厂站","nameid":"压力表","fid":"99653","kindid":"压力表类","gwid":1,"tzid":5,"nid":"rzyc-2-1-4-645955"},{"wzid":"供水滤污器前","jzid":1,"aztime":"2013-01-16T00:00:00","factoryid":"上海宜川仪表厂","modelid":"Y-100 0-1.0MPa","hrzid":"66中站","nameid":"压力表","fid":"99635","kindid":"压力表类","gwid":1,"tzid":6,"nid":"66z-1-1-1-834970"},{"wzid":"供水除污器后","jzid":2,"aztime":"2013-01-31T00:00:00","factoryid":"青岛工业仪表研究所","modelid":"Y-100 0-2.4MPa","hrzid":"66中站","nameid":"压力表","fid":"53214","kindid":"压力表类","gwid":2,"tzid":7,"nid":"66z-2-2-3-605665"},{"wzid":"供水除污器后","jzid":1,"aztime":"2013-01-08T00:00:00","factoryid":"天津丹佛斯有限公司","modelid":"Y-100 0-1.6MPa","hrzid":"染织一厂站","nameid":"压力表","fid":"4789","kindid":"压力表类","gwid":2,"tzid":8,"nid":"rzyc-1-2-3-517336"},{"wzid":"供水滤污器前","jzid":1,"aztime":"2013-01-19T00:00:00","factoryid":"上海宜川仪表厂","modelid":"Y-100 0-1.6MPa","hrzid":"染织一厂站","nameid":"压力表","fid":"6548","kindid":"压力表类","gwid":3,"tzid":9,"nid":"rzyc-1-3-1-396760"},{"wzid":"供水滤污器前","jzid":2,"aztime":"2013-01-19T00:00:00","factoryid":"天津万达仪表厂","modelid":"Y-100 0-10Bar","hrzid":"染织一厂站","nameid":"压力表","fid":"5320","kindid":"压力表类","gwid":2,"tzid":10,"nid":"rzyc-2-2-4-276184"}]}