Wagner Marques | 1 Jun 2011 14:16
Picon

EnhacedGrid contextMenu works with 1.6.1 but don't with 1.6.0


Just a information to who is using 1.6.0.

this code below render a enhancedGrid. With dojo 1.6.1 the contexMenu is render properly but with 1.6.0 don't.
So, the solution, at least for me, was upgrade to 1.6.1 (thanks dojo team). I am not a expert, but I do not know a simple 1.6.0 solution to make contexMenus works .

I just would like to inform about this.




the code
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr">
<head>
  <title>TEST Enhanced Grid Menus</title>

<style type="text/css">
 
    <at> import "./dojo-release-1.6.1-src/dijit/themes/soria/soria.css";
    <at> import "./dojo-release-1.6.1-src/dojox/grid/resources/Grid.css";
    <at> import "./dojo-release-1.6.1-src/dojox/grid/resources/soriaGrid.css";
    <at> import "./dojo-release-1.6.1-src/dojox/grid/enhanced/resources/EnhancedGrid.css");


html, body {
  height:100%;
}
</style>



<script type="text/javascript">
    var djConfig = {"parseOnLoad":true};
</script>

<script type="text/javascript" src="./dojo-release-1.6.1-src/dojo/dojo.js"></script>
<script type="text/javascript">
  dojo.require("dojo.parser");
  dojo.require("dojo.data.ItemFileWriteStore");
  dojo.require("dojox.grid.DataGrid");
  dojo.require("dojox.grid.EnhancedGrid");
  dojo.require("dojox.grid.enhanced.plugins.Menu");

  function initFn(){
     
      var headerMenu = new dijit.Menu({});
     
      headerMenu.addChild(new dijit.MenuItem({
          label: "Hide Column",
          iconClass: "dijitEditorIcon dijitEditorIconCut",
          onClick: function() {}
      }));

      var rowMenu = new dijit.Menu({});     
      rowMenu.addChild(new dijit.MenuItem({
          label: "Remove Row",
          iconClass: "dijitEditorIcon dijitEditorIconCut",
          onClick: function() {}
      }));

      var srMenu = new dijit.Menu({});     
      srMenu.addChild(new dijit.MenuItem({
          label: "Remove Selected Row(s)",
          iconClass: "dijitEditorIcon dijitEditorIconCut",
          onClick: function() {}
      }));

      var dataActions_layoutgrid = [
             {field:"chk1" },
             {field:"chk2" },
             {field:"chk3" }
                                    ];
      dataActions_store = new dojo.data.ItemFileWriteStore({data:dataActions});
     
      var gridReport=new dojox.grid.EnhancedGrid({
          id: "gridData",
          plugins: {/** dnd: true, indirectSelection: true,**/  menus: {headerMenu: headerMenu, rowMenu: rowMenu, selectedRegionMenu: srMenu}},  // Each required feature must be turned on
          query: {},
          store: dataActions_store,
          clientSort: true,
          rowSelector: "0px",
          structure: dataActions_layoutgrid
      },
      document.createElement('div'));
      dojo.body().appendChild(gridReport.domNode);
      gridReport.startup();     
  }
  dojo.ready(initFn);

</script>

 
</head>
<body class="soria">

  <script type="text/javascript">
    var dataActions = {identifier: 'id', label: 'libelle', items: [
                        {id:'1', chk1:true,  chk2:false, chk3:false, chk4:false, libelle:'Action 1'},
                        {id:'2', chk1:false, chk2:true,  chk3:false, chk4:false, libelle:'Action 2'},
                        {id:'3', chk1:false, chk2:true,  chk3:false, chk4:false, libelle:'Action 3'},
                        {id:'4', chk1:false, chk2:true,  chk3:false, chk4:false, libelle:'Action 4'},
                        {id:'5', chk1:false, chk2:true,  chk3:false, chk4:false, libelle:'Action 5'},
                        {id:'6', chk1:false, chk2:true,  chk3:false, chk4:false, libelle:'Action 6'},
                        {id:'7', chk1:false, chk2:false, chk3:true,  chk4:false, libelle:'Action 7'},
                        {id:'8', chk1:false, chk2:false, chk3:true,  chk4:false, libelle:'Action 8'},
                        {id:'9', chk1:false, chk2:false, chk3:true,  chk4:false, libelle:'Action 9'}
                      ]};
  </script>

  <!-- Store actions -->
 
</body>
</html>




--
Wagner França Marques
70768470
________________________________________________________
Dojotoolkit: http://dojotoolkit.org
Reference Guide: http://dojotoolkit.org/reference-guide
API Documentation: http://dojotoolkit.org/api
Tutorials: http://dojotoolkit.org/documentation

Dojo-interest <at> mail.dojotoolkit.org
http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
Evan | 3 Jun 2011 06:29
Picon

Re: EnhacedGrid contextMenu works with 1.6.1 but don't with 1.6.0

Thanks wagner,

BTW, it shall be related with http://bugs.dojotoolkit.org/ticket/12369 which
was fixed in 1.6.1 with http://bugs.dojotoolkit.org/changeset/24054

--
View this message in context: http://dojo-toolkit.33424.n3.nabble.com/EnhacedGrid-contextMenu-works-with-1-6-1-but-don-t-with-1-6-0-tp3010444p3018530.html
Sent from the Dojo Toolkit mailing list archive at Nabble.com.
________________________________________________________
Dojotoolkit: http://dojotoolkit.org
Reference Guide: http://dojotoolkit.org/reference-guide
API Documentation: http://dojotoolkit.org/api
Tutorials: http://dojotoolkit.org/documentation

Dojo-interest <at> mail.dojotoolkit.org
http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest

Gmane