学习日记10、easyui编辑器combobox绑定数据的两种方式

 

1、数据本地绑定

var card = [{ "value": "正常", "text": "正常" }, { "value": "挂失", "text": "挂失" }, {"value":"注销","text":"注销"}]
$('#Numbers').datagrid({
url: '@Url.Action("GetCardList")',
width: $(window).width-20,
methord: 'get',
//sortName: 'Id',
//sortOrder: 'desc',
idField: 'Id',
height: 320 + "px",
iconCls: 'icon-user_comment',
fitColumns: true,
singleSelect: true,
rownumbers: true,
columns: [[
{ field: 'Id', width: '60', hidden: true },
{ field: 'BankName', title: '开户行', width: '160', align: 'left', editor: { type: 'textbox', options: { required: true } } },
{ field: 'CardNo', title: '银行卡号', width: '180', align: 'left', editor: { type: 'textbox', options: { required: true } } },
{ field: 'CardState', title: '状态', width: '60', editor: { type: 'combobox', options: {data:card,valueField:"value",textField:"text", required: true } } },
{field: 'Delete', title: '', width: '60', formatter: function (value,row,index) {
var str = '<a id="btnDelete" style="float: left;" class="l-btn l-btn-plain"><span class="l-btn-left"><span class="l-btn-text icon-remove" onclick="Delete(' + index + ');" style="padding-left: 20px;"></span></span></a>'
return str;
}
}
]]

 

posted @ 2018-04-04 11:32  Zero77  阅读(916)  评论(0编辑  收藏  举报