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

Cannot prevent user to add a new sheet

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Critical Critical
    • 3.8.0
    • 3.5.0, 3.7.0
    • ZSS Component
    • Security Level: Jean
    • JBoss 6.2

      Cannot disable ADD_SHEET option to prevent user to create a new "tab" (sheet).

      @Override
      public void doAfterCompose(Component comp) throws Exception {        
              Spreadsheet ss = (Spreadsheet) comp;        
              ss.disableUserAction(AuxAction.ADD_SHEET, true);             
              super.doAfterCompose(ss);  //wire variables and event listeners
      }
      

      As you can see, I can click "+" button and create a new sheet "Sheet2".

      Debug Information

      It seems that ADD_SHEET is the only one in AuxAction which is not listed in the toolbar and the context menu. So it cannot be disabled via the method.

      Workaround

      jq('.zstbtn-addSheet').attr('style', 'display:none');
      

            JerryChen JerryChen
            LeonardoRosa LeonardoRosa
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: