Ignore:
Timestamp:
03/03/10 15:16:07 (2 years ago)
Author:
sys
Message:

btns asc/desc treeItemnetView

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Xul_Wsp/content/scenariWsp/views/treeItemnetView/treeItemnetView.xbl.xml

    r15013 r15014  
    8686                                <parameter name="pToolbar"/> 
    8787                                <body><![CDATA[ 
    88                                 var sView = this; 
    89                                 this.fBtnAsc = document.createElementNS(dom.XULNS, "toolbarbutton"); 
    90                                 this.fBtnAsc.setAttribute("label", "@jsStr;Asc."); 
    91                                 this.fBtnAsc.setAttribute("tooltiptext", "@jsStr;Arbre des items ascendants");  
    92                                 this.fBtnAsc.addEventListener("command", function(){ 
    93                                         sView.setViewAsc(true); 
    94                                 }, false); 
    95                                 this.fBtnDesc = document.createElementNS(dom.XULNS, "toolbarbutton"); 
    96                                 this.fBtnDesc.setAttribute("label", "@jsStr;Desc."); 
    97                                 this.fBtnDesc.setAttribute("tooltiptext", "@jsStr;Arbre des items descendants");  
    98                                 this.fBtnDesc.addEventListener("command", function(){ 
    99                                         sView.setViewAsc(false); 
    100                                 }, false); 
    101                                 pToolbar.appendChild(this.fBtnAsc); 
    102                                 pToolbar.appendChild(this.fBtnDesc); 
     88                                this.fToolbar = document.createElementNS(dom.XULNS, "box"); 
     89                                this.fToolbar.fView = this; 
     90                                this.fToolbar.setAttribute("style", "-moz-binding: url('chrome://scenariWsp/content/views/treeItemnetView/treeItemnetView.xbl.xml#toolBar');"); 
     91                                pToolbar.appendChild(this.fToolbar); 
    10392                                this.redrawStatusBtns(); 
    10493                                ]]></body> 
     
    10695                        <method name="redrawStatusBtns"> 
    10796                                <body><![CDATA[ 
    108                                 if( ! this.fBtnAsc) return; 
    109                                 if(this.getAttribute("view")=="asc") { 
    110                                         this.fBtnAsc.setAttribute("checked", "true"); 
    111                                         this.fBtnDesc.setAttribute("checked", "false"); 
    112                                 } else { 
    113                                         this.fBtnAsc.setAttribute("checked", "false"); 
    114                                         this.fBtnDesc.setAttribute("checked", "true"); 
    115                                 } 
     97                                if(this.fToolbar) this.fToolbar.redrawStatusBtns(); 
    11698                                ]]></body> 
    11799                        </method> 
     
    917899                </handlers> 
    918900        </binding> 
    919         <xbl:binding id="treeItemnetToolBar"> 
     901        <xbl:binding id="toolBar"> 
    920902                <resources> 
    921903                        <stylesheet src="chrome://scenariWsp/content/views/treeItemnetView/treeItemnetView.xbl.css"/> 
     
    926908                </content> 
    927909                <implementation> 
     910                        <field name="fBtnAsc">document.getAnonymousElementByAttribute(this, "anonid", "ascBtn")</field> 
     911                        <field name="fBtnDesc">document.getAnonymousElementByAttribute(this, "anonid", "descBtn")</field> 
    928912                        <!-- Affecte le mode d'affichage Ascendants / Descendants. --> 
    929913                        <method name="setViewAsc"> 
    930914                                <parameter name="pAsc"/> 
    931915                                <body><![CDATA[ 
    932                                 this.setAttribute("view", pAsc ? "asc": "desc"); 
    933                                 this.reset(); 
    934                                 this.fItemnetMgrCur = new this.ItemnetMgr(); 
    935                                 this.fItemnetMgrCur.registerViewer(this); 
    936                                 this.fItemnetMgrCur.init(this.fScWsp.getDataProvider(), this.fWspUri, null, pAsc); 
    937                                 this.redrawStatusBtns(); 
     916                                        if(this.fView) this.fView.setViewAsc(pAsc); 
    938917                                ]]></body> 
    939918                        </method> 
    940919                        <method name="redrawStatusBtns"> 
    941920                                <body><![CDATA[ 
    942                                 if( ! this.fBtnAsc) return; 
    943                                 if(this.getAttribute("view")=="asc") { 
     921                                if(!this.fView) return; 
     922                                if(this.fView.getAttribute("view")=="asc") { 
    944923                                        this.fBtnAsc.setAttribute("checked", "true"); 
    945924                                        this.fBtnDesc.setAttribute("checked", "false"); 
Note: See TracChangeset for help on using the changeset viewer.