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

focus() doesn't work as expected

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 3.8.0
    • 3.7.0
    • None
    • Security Level: Jimmy
    • None

      Steps to reproduce

      1. call focus() on a button like
        <button onClick="ss.focus()">focus</button>		
        			<spreadsheet id="ss" hflex="1" vflex="1"
        				showFormulabar="true" showContextMenu="true" showToolbar="true"
        				showSheetbar="true" maxVisibleRows="100" maxVisibleColumns="40"
        				src="/WEB-INF/books/blank.xlsx" />
        

      Actual result

      no focus on a Spreadsheet

      Debug information

      does not convert JSON response to an object.

      Workaround

      zk.afterLoad('zss', function() {
          var old = {};
      	zk.override(zss.Spreadsheet.prototype, old, {
      		setRetrieveFocus: function(p) {
      			p = jq.evalJSON(p);
      	        var q = this.sheetCtrl;
      	        if (!q) {
      	            return
      	        }
      	        if (this.isSheetCSSReady()) {
      	            q._cmdRetriveFocus(p)
      	        } else {
      	            q.addSSInitLater(function() {
      	                q._cmdRetriveFocus(p)
      	            })
      	        }
              }
         });
      });	
      

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

              Created:
              Updated:
              Resolved: