Using dijit Tooltip in relationship grid – how to get connectId?

Hi, I want to add a dijit tooltip to a column in the relationship grid. The tooltip shall open, when elements of this specific column are selected. For a first test I used an onSelectRow Method in the corresponding RelationshipType. Currently I try to run the following sample: https://dojotoolkit.org/reference-guide/1.10/dijit/Tooltip.html
require(["dijit/Tooltip", "dojo/domReady!"], function(Tooltip){
    new Tooltip({
        connectId: ["exampleNode"],
        label: "the text for the tooltip"
    });
});
Right now I have some trouble to get the correct "connectId" for the tooltip element. Any ideas of how to use this parameter? I am already able to open a standard dijit dialog in a similar way. But the standard dialog is always placed in the middle of the screen and not connected to a certain cell position. Thanks for your help! Angela
Parents
  • Hi Angela, You're correct that there isn't a onSelectCell event. Beyond writing a custom relationship grid, adding this code to the onSelectRow event is probably your best bet. The individual cells don't have IDs on them, but it looks like you might be able to use this code from the link you provided to attach a tooltip to all of the cells in the grid.
    require(["dijit/Tooltip", "dojo/query!css2", "dojo/domReady!"], function(Tooltip){
    new Tooltip({
    connectId: "myTable", // <-- You'll need to look up the ID of the grid
    selector: "tr", // <-- You can change this to "td" to add the tooltip to every cell instead of every row
    getContent: function(matchedNode){
    return matchedNode.getAttribute("tooltipText"); // <-- You can add logic here to lookup the appropriate information based on the selected cell
    }
    });
    });
    Could you clarify what kind of information you'd like to display from the cells? Chris
    Christopher Gillis Aras Labs Software Engineer
Reply
  • Hi Angela, You're correct that there isn't a onSelectCell event. Beyond writing a custom relationship grid, adding this code to the onSelectRow event is probably your best bet. The individual cells don't have IDs on them, but it looks like you might be able to use this code from the link you provided to attach a tooltip to all of the cells in the grid.
    require(["dijit/Tooltip", "dojo/query!css2", "dojo/domReady!"], function(Tooltip){
    new Tooltip({
    connectId: "myTable", // <-- You'll need to look up the ID of the grid
    selector: "tr", // <-- You can change this to "td" to add the tooltip to every cell instead of every row
    getContent: function(matchedNode){
    return matchedNode.getAttribute("tooltipText"); // <-- You can add logic here to lookup the appropriate information based on the selected cell
    }
    });
    });
    Could you clarify what kind of information you'd like to display from the cells? Chris
    Christopher Gillis Aras Labs Software Engineer
Children
No Data