How to display data in column based on select in webgrid handsontable

62 Views Asked by At

How to display data in column based on select ?I've seen the documentation, but it's very confusing, maybe some can help

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

There are 1 best solutions below

0
Rizky Fathurahman On
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'));
    }