w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
how to update cell based on another autocomplete cell with Handsontable

They have defined exactly how to do it in their documentation:

$("#example3").handsontable({
  data: getCarData(),
  startRows: 7,
  startCols: 4,
  colHeaders: ["Car", "Year", "Chassis color", "Bumper color"],
  columns: [
    {
      type: 'autocomplete',
      source: function (query, process) {
        $.ajax({
          //url: 'php/cars.php', //commented out because our website is
hosted on static GitHub Pages
          url: 'json/autocomplete.json',
          dataType: 'json',
          data: {
            query: query
          },
          success: function (response) {
              console.log("response", response);
              //process(JSON.parse(response.data)); //JSON.parse takes
string as a argument
              process(response.data);

          }
        });
      },
      strict: true
    },
    {} /*Year is a default text column*/,
    {} /*Chassis color is a default text column*/,
    {} /*Bumper color is a default text column*/
  ]
});




© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.