单击 dijit/layout/AccordionPane 更新图像

Update Image on Click the dijit/layout/AccordionPane

我是 Dojo 的新手,有一个代码,我想在用户 select 手风琴时更新图像。代码就是这样写的。

    <div data-dojo-type="dijit/layout/AccordionContainer" data-dojo-props="minSize:20, region:'leading', splitter:true" style="width: 300px;" selected="true" >
       <div data-dojo-type="dijit/layout/AccordionPane" title="<img src='./icons/system-run.png' border='0'/>&nbsp;Application" id="_application_AccordionPane">
                <div id="menuTree"></div>
       </div>
       <div data-dojo-type="dijit/layout/AccordionPane" title="<img src='./icons/help-about.png' border='0'/>&nbsp;Message" id="_message_AccordionPane" >
                <p id="_my_message"></p>
       </div>
    </div>

我正在使用 dojo-release-1.16.3.jar 并且只想在用户单击手风琴时更新图像。提前致谢

我已经解决了这个问题,并把这段代码提供给那些面临同样问题的人,如下所示。

    <div class="custon" data-dojo-type="dijit/layout/AccordionContainer" data-dojo-props="minSize:20, region:'leading', splitter:true" style="width: 300px;" selected="true" >
        
        <div  data-dojo-type="dijit/layout/AccordionPane" title="<img src='./icons/system-run.svg' border='0' width='14px' height='14px'  />&nbsp;$&nbsp;&nbsp;{action.getText('IndexAction_applicationName')}" id="_application_AccordionPane">
        <script type="dojo/method" data-dojo-event="onHide" data-dojo-args="value">
            onHideApplication()     
        </script>
        <script type="dojo/method" data-dojo-event="onShow" >
            onActiveApplication()       
        </script>
            <div id="menuTree"></div>
        </div>
    </div>

在javascript

<script type="text/javascript">

function onHideApplication()
{
    if(dijit.byId('_application_AccordionPane').selected)
    {
        dijit.byId("_application_AccordionPane").set("title", "<img src='./icons/system-run.svg' border='0' width='14px' height='14px' style='margin-right:10px;' />&nbsp;${action.getText('IndexAction_applicationName')}");
    }
    else
    {
        dijit.byId("_application_AccordionPane").set("title", "<img src='./icons-InActive/system-run.svg' border='0' width='14px' height='14px' style='margin-right:10px;' />&nbsp;${action.getText('IndexAction_applicationName')}");  
    }
    
}
function onActiveApplication()
{
    if(dijit.byId('_application_AccordionPane').selected)
    {
        dijit.byId("_application_AccordionPane").set("title", "<img src='./icons/system-run.svg' border='0' width='14px' height='14px' style='margin-right:10px;'  />&nbsp;${action.getText('IndexAction_applicationName')}");
    }
    else
    {
        dijit.byId("_application_AccordionPane").set("title", "<img src='./icons-InActive/system-run.svg' border='0' width='14px' height='14px' style='margin-right:10px;' />&nbsp;${action.getText('IndexAction_applicationName')}");  
    }
    
}
</script>