columns: [
{
text: 'Ship City', datafield: 'ShipCity', width: 150, columntype: 'combobox',
createeditor: function (row, column, editor) {
// assign a new data source to the combobox.
var list = ['Stuttgart', 'Rio de Janeiro', 'Strasbourg'];
editor.jqxComboBox({ source: list, promptText: "Please Choose:" });
},
// update the editor's value before saving it.
cellvaluechanging: function (row, column, columntype, oldvalue, newvalue) {
// return the old value, if the new value is empty.
if (newvalue == "") return oldvalue;
}
},
{
text: 'Ship Country', datafield: 'ShipCountry', width: 150, columntype: 'dropdownlist',
createeditor: function (row, column, editor) {
// assign a new data source to the dropdownlist.
var list = ['Germany', 'Brazil', 'France'];
editor.jqxDropDownList({ source: list });
},
// update the editor's value before saving it.
cellvaluechanging: function (row, column, columntype, oldvalue, newvalue) {
// return the old value, if the new value is empty.
if (newvalue == "") return oldvalue;
}
},
{ text: 'Ship Name', datafield: 'ShipName', columntype: 'combobox' }
]
JQXGrid以自定义数据为表格下拉框的值
最新推荐文章于 2021-01-03 11:34:46 发布
本文介绍了一种表格编辑器的配置方法,通过设置不同的列类型如下拉框和组合框等,实现对表格中特定字段的高效编辑。具体包括如何为这些控件分配数据源、如何处理空值输入等问题。
2185

被折叠的 条评论
为什么被折叠?



