首页新闻找找看学习计划

关于easy ui

0
[待解决问题]

有没有combotree的例子啊!各位大神,菜鸟一个!

码农arthur_yao的主页 码农arthur_yao | 菜鸟二级 | 园豆:213
提问于:2014-08-21 16:54
< >
分享
所有回答(3)
0
 $('#goodId').combogrid({  
                panelWidth:360,  
                value:'',  
                idField:'ym00301',  
                textField:'bs00202',  
                url:'/OtherHtml/handler/02503/ComboxGrid.ashx', 
             
                columns:[[  
                    {field:'ym00301',title:'ID',width:60,hidden:'true'},  
                    {field:'bs00202',title:'商品编号',width:100},  
                    {field:'bs00203',title:'商品名称',width:100},  
                    {field:'bs00205',title:'商品规格',width:100},
                    {field:'st00102',title:'商品单位',width:100,hidden:'true'} 
                ]],
                onSelect: function () {              //选中处理
                  var val = $('#goodId').combogrid('getValue');
                  childId=val;
                  getDetai(val);
                  var grid=$("#goodId").combogrid("grid");
                   var row = grid.datagrid('getSelected');//获取行数据
                   $("#goodName").val(row.bs00203);
                   $("#goodStyle").val(row.bs00205);
                   $("#goodUnit").val(row.st00102);   
                      }
            }); 

获取到json

{"total":21,"rows": [{"ym00301":"0077daa8-6004-4dcd-9d05-9625b7b036a0","bs00201":"73fb717f-e588-4de7-9fba-8bc6223a4d1b","bs00202":"SPZL000027","bs00203":"y1","bs00205":"","st00102":""},{"ym00301":"03e55ce8-1078-43e3-8eb6-69b3792a1285","bs00201":"8e1323bd-b7a2-4ef6-886a-61e4c6ebce46","bs00202":"SPZL000020","bs00203":"计划产品","bs00205":"","st00102":""},{"ym00301":"0441e89c-95b0-4daf-a712-07e8b54b5e2e","bs00201":"d7003c79-fb9d-4eb9-92a3-c68acb494bf0","bs00202":"SPZL000037","bs00203":"简单电脑","bs00205":"","st00102":""},{"ym00301":"312bca80-0e21-4222-ab55-6200b7981c90","bs00201":"9ef1360c-e493-468c-8db0-b2e9d77129b1","bs00202":"SPZL000038","bs00203":"0库存","bs00205":"","st00102":""},{"ym00301":"4060d01f-c6a1-4b8e-9b03-a2904d4cfebe","bs00201":"4fbaffc1-d7b6-4dbb-b74e-514fada88008","bs00202":"SPZL000015","bs00203":"W=2A(2x+4y)+3B(x+3y)","bs00205":"","st00102":""},{"ym00301":"426bfea7-2e8d-402d-b9fe-2688dfc2b9e2","bs00201":"5d10f987-4b84-40ca-908b-aa0a970f69dd","bs00202":"SPZL000001","bs00203":"自行车","bs00205":"山地自行车","st00102":""},{"ym00301":"49786e2f-3174-4ca5-853e-8f563fe224f2","bs00201":"a038af1f-008f-4eab-b7da-c01e9d3b34b7","bs00202":"SPZL000019","bs00203":"y","bs00205":"","st00102":""},{"ym00301":"4b7edf49-cbb8-4acb-be27-26b08f2de933","bs00201":"012402d1-c158-4583-b825-242bfa3158ae","bs00202":"SPZL000036","bs00203":"组装电脑","bs00205":"","st00102":""},{"ym00301":"564ce3b6-86e6-43f0-9b6a-0dde2b268f24","bs00201":"3a811425-27de-4f43-b2bd-9c5e64d0addb","bs00202":"B2","bs00203":"2-B","bs00205":"","st00102":""},{"ym00301":"6b9f088a-5bb0-4672-8a22-b15d2763b4de","bs00201":"14641b19-3f25-4545-b528-f69a6af66d06","bs00202":"SPZL000016","bs00203":"A=2x+4y","bs00205":"","st00102":""},{"ym00301":"7d3d3819-2545-4acf-a0a4-865e78f87474","bs00201":"8ebdb859-93bb-4394-aee1-81cdbbc337c6","bs00202":"SPZL000017","bs00203":"B=x+3y","bs00205":"","st00102":""},{"ym00301":"b32300e4-e647-4e48-944a-62e959142507","bs00201":"d92f6327-44ff-4bd7-890e-fc76bdb3facb","bs00202":"A2","bs00203":"2-A","bs00205":"","st00102":""},{"ym00301":"bad961ed-5f99-42f1-871f-d0510027400e","bs00201":"881db074-290d-4ffb-9ebb-bc9a7b44aa7c","bs00202":"SPZL000018","bs00203":"x","bs00205":"","st00102":""},{"ym00301":"c798cb1b-28b1-4b63-bd95-21b6105e7371","bs00201":"10eb1593-e812-4626-a190-ad4538d2c04a","bs00202":"SPZL000005","bs00203":"鲤鱼","bs00205":"新鲜","st00102":""},{"ym00301":"ca58bb13-4503-4bd0-b92e-11c76888e8db","bs00201":"9234b932-a2df-461a-bcc1-5a11ae920862","bs00202":"A1","bs00203":"1-A","bs00205":"","st00102":""},{"ym00301":"cd989a3f-dd57-498a-91dc-30abab97041d","bs00201":"b031d44e-20a0-46fb-990e-c41b21b2f439","bs00202":"SPZL000013","bs00203":"台式电脑","bs00205":"","st00102":""},{"ym00301":"d0dfda9d-8a07-4a33-a5b0-fd770831ef64","bs00201":"5511be7c-3407-4ded-b123-fb4858a84e26","bs00202":"C2","bs00203":"2-C","bs00205":"","st00102":""},{"ym00301":"e1cc90ac-d94b-4251-85aa-f3ba8aea0da7","bs00201":"b996cc10-5a6c-4951-9df1-8f95a9238087","bs00202":"SPZL000025","bs00203":"x1","bs00205":"","st00102":""},{"ym00301":"e4ee1ba0-f21c-4205-a2d3-e3cdd6c17f37","bs00201":"319f8851-ee4d-441d-8648-ac1d8499d9f3","bs00202":"XXL","bs00203":"超级物品","bs00205":"","st00102":""},{"ym00301":"efefdc14-c6d0-43c7-aeb6-4652ab5dc1e6","bs00201":"8926115f-6c85-4d8f-bdc9-fc9e670c3e80","bs00202":"SPZL000012","bs00203":"笔记本电脑","bs00205":"","st00102":""},{"ym00301":"fe8e8fe7-984d-44e9-956d-f611d54f7d76","bs00201":"43b29a8c-b41d-4ff4-811a-35fe1fd24713","bs00202":"B1","bs00203":"1-B","bs00205":"","st00102":""}]}

和datagird绑定差不多

结果 

亦有哭亦有笑 | 园豆:5 (初学一级) | 2014-08-21 17:02

谢谢!那有没有combotree  在网上官网查了写资料  然后自己动手  各种坑啊!

支持(0) 反对(0) 码农arthur_yao | 园豆:213 (菜鸟二级) | 2014-08-21 17:05

@姚剑锋: 也有http://api.btboys.com/easyui/

要注意json的格式和js文件的版本,

支持(0) 反对(0) 亦有哭亦有笑 | 园豆:5 (初学一级) | 2014-08-21 17:08
0

combotree的例子,测试通过:

http://download.csdn.net/download/lorant/6317613

LiuKaiFa | 园豆:1491 (小虾三级) | 2014-08-22 08:52
0

js: 初始化

$('#ContractType').combotree({
//获取数据URL
url: '../../Json/ContractJson.aspx?action=ContractTypeTree',
required: true,
panelHeight: 'auto',
//选择树节点触发事件
onSelect: function (node) {
//返回树对象
var tree = $(this).tree;
//选中的节点是否为叶子节点,如果不是叶子节点,清除选中
var isLeaf = tree('isLeaf', node.target);
if (!isLeaf) {
//清除选中
$('#ContractType').combotree('clear');
}
}
});

后台:返回一个List<Dictionary<int ,string>>的JSON就行了

三国郭海 | 园豆:280 (菜鸟二级) | 2014-08-22 10:59
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册