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

Can't clear a filter then apply it in same au

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: Normal Normal
    • 3.5.0
    • 2.5.0
    • ZSS Component

      Steps to Reproduce:

      1. load the attached Excel
      2. follow instructions on the ZUL page below
      <?page title="ZSS" contentType="text/html;charset=UTF-8"?>
      <zk>
      	<window title="ZSS Selection Events" border="normal" width="100%"
      		height="100%">
      		<label multiline="true">
      		1.select on C13 (Header2) then click on applyFilter button
      		
      		Expected:
      		filter on A1 should be cleared and C13 has filter now.
      		Actual:
      		filters displayed a A1 (Header1), C13(Header2) 
      		
      		click clear filter button, A1 filter still exists.
      		if you click on it, you get error
      		
      		()excel only allow one filter)
      		</label>
      		<zscript><![CDATA[
      			void applyFitler(){
      				
      				clearFilter(); //Notice!!
      				Worksheet sheet = ss.getSelectedSheet();
      				Rect r = ss.getSelection();
      				System.out.println("apply fitler on "+r);
      				Ranges.range(sheet,r.getTop(),r.getLeft(),r.getBottom(),r.getRight()).autoFilter();
      				
      			}
      			
      			void clearFilter(){
      				Worksheet sheet = ss.getSelectedSheet();
      				if(sheet.getAutoFilter()!=null){
      					//toggle clear
      					Ranges.range(sheet).autoFilter();
      				}
      			}
      		]]>
      		</zscript>
      		<hlayout>
      			<button label="applyFilter" onClick="applyFitler()"/>
      			<button label="clearFitler" onClick="clearFilter()"/>
      		</hlayout>
      		<spreadsheet id="ss" width="300px" height="600px" maxrows="35" onCellSelection="/*for bug of cell selection*/"
      			maxcolumns="10" src="/issue/221-autoFilter.xlsx">
      		</spreadsheet>
      	</window>
      </zk>
      

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

              Created:
              Updated:
              Resolved: