mercredi 3 octobre 2018

Handsontable how to test custom render in React js Here is the code. To be specific how to test "negativeValueValidator"

This is for custom render

  {
        numericFormat: {
          pattern: "$0,0.00",
          culture: "en-US"
        },
        renderer: this.negativeValueValidator
      }

This is for custom render

 negativeValueValidator(instance, td, row, col, prop, value, cellProperties) {
    console.log("intsnave", cellProperties.className);
    Handsontable.renderers.NumericRenderer.apply(this, arguments);
    if (isNaN(value)) {
      td.style.background = "red";
    }
    if (parseInt(value, 10) < 0) {
      if (!isNaN(value)) td.style.color = "red";
    }
  }

Now How to test the "negativeValueValidator" in react js

Aucun commentaire:

Enregistrer un commentaire