Uploaded image for project: 'ZK Spreadsheet'
  1. ZK Spreadsheet
  2. ZSS-760

Provide control to avoid unnecessary auto update on setXxx()

XMLWordPrintable

    • Icon: New Feature New Feature
    • Resolution: Done
    • Icon: Normal Normal
    • 3.6.0
    • 3.5.0
    • None
    • None

      When calling Range#setXxx(), zk spreadsheet will automatically check cell dependencies, update the dependent cells and refresh the spreadsheet UI of the range. However, in some cases, developers might not want such "automation" and like to control the evaluation and update(see ZSS-751) by themselves. Thus we provide this method.

      Range.java
      /**
       * Turn on(true)/off(false) of auto refresh of this range and return previous on/off status.
       */
      public boolean setAutoRefresh(boolean auto);
      
      MyApp.java
      ...
      boolean old = range.setAutoRefresh(false); // turn off auto update of this range
      try {
          range.setEditText(...); // do whatever setXxx() operation; will not evaluate and update automatically
          ...
      } finally {
          range.setAutoRefresh(old); // set to previous value
      }
      

            henrichen henrichen
            henrichen henrichen
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: