宇筱博客

  • 解决办法
  • 学无止境
  • 记录时光
  • 百宝箱
宇筱博客
点滴记忆,汇聚成海。
  1. 首页
  2. 解决办法
  3. 正文

datagrid 表格下拉框

2017年1月1日 518点热度 0人点赞 0条评论

直接给JSON串:

var products = [
            {productid:'FI-SW-01',name:'Koi'},
            {productid:'K9-DL-01',name:'Dalmation'},
            {productid:'RP-SN-01',name:'Rattlesnake'},
            {productid:'RP-LI-02',name:'Iguana'},
            {productid:'FL-DSH-01',name:'Manx'},
            {productid:'FL-DLH-02',name:'Persian'},
            {productid:'AV-CB-01',name:'Amazon Parrot'}
        ];

{
  field: 'Ptype',
  title: '类别', 
  width: 200,
  editor:{
    type:'combobox',
    options:{
      valueField:'productid',
      textField:'name',
      data:products,
      required:true
         }
     }
}

感谢CSDN用户showbo提供答案

使用查询数据给值:

codeClass.editor = {
		type : 'combobox',
		options : {
			valueField : 'generalCode',
			textField : 'categoryName',
			method : 'post',
			url : '/bfs/bfs/configuration/categoryclassbysystemtype?systemType='+systemType,
			required : true,
			editable:true,
  			onLoadSuccess : function(data) {
  				if(data && data.length>0){
  					$(this).combobox('select',data[0].generalCode);
  				}
  				
  			},
		}
	};

标签: 暂无
最后更新:2017年1月1日

小渔民

这个人很懒,什么都没留下

点赞
< 上一篇
下一篇 >

文章评论

razz evil exclaim smile redface biggrin eek confused idea lol mad twisted rolleyes wink cool arrow neutral cry mrgreen drooling persevering
取消回复

COPYRIGHT © 2025 宇筱博客. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang

豫ICP备15017825号-2