0

An idea for a Ninext tweak.



Would this be possible?

To have a tooltip concept when hovering over a cell that displays the full content of that cell.  This could be handy where cell width is reduced, and the text is cut off.

7 replies

null
    • Ninox developper
    • Jacques_TUR
    • 2 wk ago
    • Reported - view

    You can try this JavaScript function which modifies the tooltip of the chmap whose name is passed as a parameter.

    function setTooltip(fieldName : text,tooltip : text) do
        var fn := fieldName;
        var tt := tooltip;
        #{:text
            // find the component nammed fn
            var r = ui.getCurrentEditor().currentTab.components.find( c => c.field.caption == fn)
            // set tooltip on tp
            if (r && r.el[0])
            r.el[0].title = tt;
        }#
    end;
    

    You can place the function in the "Display only if..." trigger so that the tooltip is updated each time the field is modified.

    Ideally, you should put the function in the global functions so that you can call it from any field in the database.

    Please note: it is not possible to call the function from an "After update" trigger as this is executed on the server and not locally.

      • Alan_Cooke
      • 2 wk ago
      • Reported - view

       Hi there,  I tried this in Display if and result was that the field did not display at all (same as a null).  Do I need to substitute anything in the sample code or simply copy and past into the field Display if.

      • Ninox developper
      • Jacques_TUR
      • 2 wk ago
      • Reported - view

       just add « true » at the end of code. 
       

      function setTooltip(fieldName : text,tooltip : text) do
          var fn := fieldName;
          var tt := tooltip;
          #{:text
              // find the component nammed fn
              var r = ui.getCurrentEditor().currentTab.components.find( c => c.field.caption == fn)
              // set tooltip on tp
              if (r && r.el[0])
              r.el[0].title = tt;
          }#
      end;
      
      true;
      
      • Alan_Cooke
      • 2 wk ago
      • Reported - view

       I tried that but it does not work, I assume I am doing something wrong.  Copied the sample code into Display if.   Field now shows but hovering over the field has no effect.

      • Ninox developper
      • Jacques_TUR
      • 2 wk ago
      • Reported - view

       Sorry, I forget to call function 😅

      Replace "YOUR FIELD NAME" by the name of field. 

      function setTooltip(fieldName : text,tooltip : text) do
          var fn := fieldName;
          var tt := tooltip;
          #{:text
              // find the component nammed fn
              var r = ui.getCurrentEditor().currentTab.components.find( c => c.field.caption == fn)
              // set tooltip on tp
              if (r && r.el[0])
              r.el[0].title = tt;
          }#;
      
      end;
      setTooltip( "YOUR FIELD NAME", "The value of tooltip" );
      true;
      
      • Alan_Cooke
      • 2 wk ago
      • Reported - view

       100% - Now I can remove the Alert to display the full field value in OnClick.

    • Alan_Cooke
    • 2 wk ago
    • Reported - view

    Is it possible to have this function in (all), sheet, table mode?
     

    In other words, if a column is too narrow the DESCRIPTION would display on hover.

Content aside

  • Status Answered
  • 2 wk agoLast active
  • 7Replies
  • 77Views
  • 2 Following