Handsontable example

by kranthi2210

HTML

<div id="example1" class="hot handsontable htColumnHeaders"></div>

CSS

</style><!-- Ugly Hack due to jsFiddle issue -->

<script src="https://cdn.jsdelivr.net/npm/handsontable@8.3.1/dist/handsontable.full.min.js"></script>
<link type="text/css" rel="stylesheet" href="https://cdn.jsdelivr.net/npm/handsontable@8.3.1/dist/handsontable.full.min.css">
<script src="https://handsontable.com/docs/8.3.1/components/numbro/dist/languages.min.js"></script>

JavaScript

var container = document.getElementById('example1'),
   hot = new Handsontable(container, {
     data: [{
       id: 1,
       number: 23
     }, {
       id: 1,
       number: ''
     }, {
       id: 1,
       number: 18
     }, ],
     colHeaders: true,
     columns: [{
         data: 'id'
       },
       {
         data: 'number',
         type: 'numeric',
         required:false,
         validator: function(value, callback) {
        
          if (value < 100 && value > 10) {
             callback(true);
           } else {
             callback(false);
           }
         
          
         }
       },
     ]
   });

hot.validateCells()