如何基于select在列中显示数据?我已经看过文档,但这很令人困惑,也许有些可以帮助您
var setting={
data: []
,
minSpareRows: 20,
columns: [
{type: 'dropdown', numericFormat: {pattern: '000'}, validator: 'tps', source: myTps}
{type: 'text', allowInvalid: true, editor:false}
],
rowHeaders: true,
colHeaders: ["id","NKK"],
filters: true,
dropdownMenu: false,
width: resizeGrid(),
height: 500,
maxRows: 300,
}
var myTps = [];
function loadTps(data) {
data.forEach(element => {
myTps.push(element.tps_no)
});
}
function getTps() {
let url = '/dpdraft2/index/getTps';
const my = this;
var res = axios.get(url)
.then(function(response) {
loadTps(response.data)
})
.catch(error => console.log('error axios'));
}