Forum Discussion

michelle's avatar
michelle
Creator II
8 years ago

Grids row double click open form

Hi I use Grids and setting grids column is related  by Identity, I want double click grid row can open Identity form. I reference method but  don't know how to combined. var gridApp=grid.applet;  -->I get my grid clientControlsFactory.createControl("Aras.Client.Controls.Public.GridContainer", { onStartSearch_Experimental: doSearch }, function(control) { grid = control; clientControlsFactory.on(grid, { "onStartEdit_Experimental": startCellEditSD, "gridXmlLoaded": function () { grid.setMultiselect(multiselect); }, "onApplyEdit_Experimental": applyCellEditSD, "gridDoubleClick": onDoubleClick, "onInputHelperShow_Experimental": showInputHelperDialog, "gridLinkClick": function (linkVal) { if (linkVal.length) { linkVal = linkVal.replace(/'/g, ""); var typeName = linkVal.split(",")[0]; var id = linkVal.split(",")[1]; aras.uiShowItem(typeName, id); } } }); });

6 Replies

  • Hi Michelle, I've worked a little with custom grids, and I've been able to recreate this functionality by defining my onDoubleClick function as below. Chris _____________________________________ Christopher Gillis Aras Labs Software Engineer
  • Hi I setting your method in Grids Method, but my method can not  trigger double click event. How to trigger on double click event. Method Code: var virtualGridNode = document.createDocumentFragment(); clientControlsFactory.createControl("Aras.Client.Controls.Public.GridContainer", connectNode: virtualGridNode, function(control) { grid = gridApplet = control; clientControlsFactory.on(grid, { "gridDoubleClick": onDoubleClick(0) }); }); function onDoubleClick(row) { // If the line below does not return the ID you want, // you should be able to find it in the 'row' argument passed in to this function var selectedId = grid.getSelectedId(); if (!selectedId) { return; } // The first argument of this function will be the name of the ItemType you are trying to open. In this case, 'Identity'. aras.uiShowItem('Identity', selectedId); return true; }    
  • Hi Michelle, The grid event arguments expect to be given only the names of the functions that should run when that event is triggered. Because of this you should leave off the parentheses that come after the function name as seen in the sample below.
    clientControlsFactory.createControl(“Aras.Client.Controls.Public.GridContainer”, connectNode: virtualGridNode, function(control) {
    grid = gridApplet = control;
    clientControlsFactory.on(grid, {
    “gridDoubleClick”: onDoubleClick
    });
    });
    Please let me know if updating your code to match the above sample resolves this issue for you. Chris _______________________________________ Christopher Gillis Aras Labs Software Engineer
  • Hi I use your function can not trigger. Is this parameter " connectNode: virtualGridNode"  need to change else? var virtualGridNode = document.createDocumentFragment(); clientControlsFactory.createControl(“Aras.Client.Controls.Public.GridContainer”, {connectNode: virtualGridNode}, function(control) { grid = gridApplet = control; clientControlsFactory.on(grid, { “gridDoubleClick”: onDoubleClick(0) }); });  
  • Hi Michelle, In order to trigger this function on the "gridDoubleClick" event, you will need to pass the function in as a parameter which is done by just passing in the name of the function without any parenthesis like below. "gridDoubleClick": onDoubleClick Note that in the above example we did not use 'onDoubleClick(0)' which would cause our double click event to always run against Row 0 regardless of what row was actually clicked on. Chris __________________________________ Christopher Gillis Aras Labs Software Engineer    
  • Hi I use this method can not trigger when I double click grids row. var virtualGridNode = document.createDocumentFragment(); clientControlsFactory.createControl(“Aras.Client.Controls.Public.GridContainer”, {connectNode: virtualGridNode}, function(control) { grid = gridApplet = control; clientControlsFactory.on(grid, { “gridDoubleClick”: onDoubleClick }); });