Declarative dojox.grid.datagrid's header has onclick event?

你说的曾经没有我的故事 提交于 2019-12-12 02:19:48

问题


  • Is it possible to have onclick in dojox.grid.datagrid's header.
  • I tried calling a function in header's onclick.. but it doesn't work.

    <div class="claro" id="cvsd" name="dataGrid" onclick="getConnect('inner__cvsd');setWidgetproperty(this.id,'xy','inner__cvsd');" ondblclick="editCustomGrid(this.id)" onmouseup="setDocStyle(this.id)" style="height: 200px; left: 44px; position: absolute; top: 114px; width: 950px;">
     <table class="claro" dojotype="dojox.grid.DataGrid" id="inner__cvsd" rowselector="10px" style="height: 180px; width: 400px;">
          <thead>
               <tr>
                    <th field="Column1" id="Column1_2" width="100px" onclick="getConnect();">
                        Column1
                    </th>
               </tr>
          </thead>
     </table>
     <input id="hidden__cvsd" name="dataGrid" style="display:none;" type="hidden">
    


回答1:


There's an event called onHeaderCellClick which will probably do the job. If you need to get more information about events and such things I recommend reading the API Documentation. I wrote an example JSFiddle (grid is created programmatically, but you can do that declarative too) which you can find here.

The code that I use to call the event is the following:

onHeaderCellClick: function() {
    console.log("Header clicked");  
},

But of course, you can change this with whatever you like.



来源:https://stackoverflow.com/questions/15893300/declarative-dojox-grid-datagrids-header-has-onclick-event

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!