Как отобразить данные в столбце на основе выбора в веб-сетке - PullRequest
0 голосов
/ 05 марта 2020

Как отобразить данные в столбце на основе выбора? Я видел документацию, но это очень запутанно, может быть, некоторые могут помочь

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,

}

1 Ответ

0 голосов
/ 05 марта 2020
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'));
    }
...