jQuery MiniUI

 找回密码
 立即注册
查看: 3953|回复: 5
打印 上一主题 下一主题

combobox有移除某项或清空所有items的方法吗? [复制链接]

Rank: 3Rank: 3

跳转到指定楼层
楼主
发表于 2013-1-19 11:14:31 |只看该作者 |倒序浏览
var name = mini.get("combo_name");
var items = name.getColumns();
name.removeItems(items);
清空combobox,没起作用

Rank: 9Rank: 9Rank: 9

沙发
发表于 2013-1-19 14:34:50 |只看该作者
combo.setData([]);

Rank: 3Rank: 3

板凳
发表于 2013-1-20 09:39:02 |只看该作者
niko 发表于 2013-1-19 14:34
combo.setData([]);

这是清空,那移除某一项呢?

Rank: 9Rank: 9Rank: 9

地板
发表于 2013-1-20 13:44:54 |只看该作者
var data = combo.getData();
//data是一个数组,你可以增加、删除项,然后
combo.setData(data);

Rank: 3Rank: 3

5#
发表于 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"}]}

我想在前台获得sql的值,如何做到?

Rank: 9Rank: 9Rank: 9

6#
发表于 2013-1-20 16:45:21 |只看该作者
grid.on("load", function(e){
    e.result.sql
});

Archiver|普加软件

GMT+8, 2024-11-30 17:55 , Processed in 1.053180 second(s), 9 queries .

Powered by Discuz! X2

© 2001-2011 Comsenz Inc.

回顶部