11

Ninext project

good evening to all, 

I create this post to organize the Ninext project. For those who are new to it, it is composed of several JavaScript modules that allow you to add badges on tabs and buttons, catch selection events on views, execute JavaScript from Ninox script, inspect dependencies between database fields.

This post is here to talk about the project and the procedure for those who would like to implement it in your databases. I would like to take this opportunity to remind you that this is a test project that evolves regularly and I invite you to be cautious and not to use it on commercial databases for the moment.

The sources of the project are available and downloadable on Github
Thanks to all of you for all your messages of support and for your help to debug and make the project progress a little more every day 🙏.

I made the project initiation procedure evolve thanks to the precious help of M. Daaboul who told me that we could use the Ninox dialog box with HTML code. It is no longer necessary to create a window and an HTML field for this. You just have to copy the code below in the Trigger after open in the Options

 

var code := http("GET", "https://raw.githubusercontent.com/JacquesTur/Ninext/main/loadModules.html").result;
dialog("Ninext intialization", "<script>
window.exConfigLoadModules = {
    completion: false,
    badges: true,
    evalJS: true,
    viewEvent: true,
    buttonEvent : true,
    fieldsInspector: true,
    nativeJS: true,

    autoCloseDialog: true
};
</script>" + code, ["close"])

The dialog box will be displayed stealthily then disappear. If you want it to stay displayed with its "close" button, set the autoCloseDialog parameter to false.

141 replies

null
    • NYNNA
    • Louis_Cornacchia
    • 1 mth ago
    • Reported - view

    jacques, I installed ninext almost 2 years ago, I think. Do I need to update the code? If so, do you have instructions for doing this?

      • Jacques_TUR
      • 1 mth ago
      • Reported - view

      Send me an email to Jacques.tur@neuf.fr and I will send you the installation procedure.

    • Jacques_TUR
    • 1 mth ago
    • Reported - view

    Hello everyone,

    Yesterday,  reported a bug related to the "onclick" event in the view fields. It was no longer functioning on tablets and phones. This issue has now been fixed. Many thanks to Philip for bringing this problem to our attention.

    Since I had two other ongoing changes, I took the opportunity to release them as well:

    1 - Added a delay between successive calls to the debug() function. This allows us to determine the time it takes for a loop or formula to execute. It's particularly useful when dealing with lengthy calculation chains. As an example, thanks to this simple option, I was able to identify a poorly written query and reduce the execution time from 20 seconds to 200 milliseconds.

    2 - In the table editing window, I changed the color of the tabs in the field list to distinguish them from the selection color of a field. It might be a small change, but again, it enhances both efficiency and clarity.

     

     

    All of these updates are now live in version 2.1.22 beta.

      • Philip_Canonica
      • 1 mth ago
      • Reported - view

       Thank you very much for the quick Release!
      It works on iPad. And I will test it on Chrome as soon as I have the Chance to do it. I would let you know if something doesn't work properly. 

      • Fred
      • 10 days ago
      • Reported - view

      I was wondering if you have any documentation on how to use the debug() function of Ninext? I have a dashboard that is really slow so I would like to try to figure out where the problem is.

      Can debug get load times of formula columns in a view element?

      I've also setup a DB to copy Ninext so it loads even if there is network issues, but when I try to turn modules off, they still load when I open the DB.

      For example I have this in the Options:

      ninext.start({
          badges: true,
          viewEvent: true,
          buttonEvent : true,
          fieldsInspector: true,
          nativeJS: false,
          tableView: true,
          debugTracer : true,
          languages : false,
          errorsViewer : true,
          darkMode : false,
          codeFinder : true,
      autoCloseDialog:  " +
      

      Then this happens on startup:

      So NativeJS shouldn't have loaded but it does.

      • Jacques_TUR
      • 9 days ago
      • Reported - view

      Thank you for your message.

      When the debugTracer module is loaded, a 'Debug Tracer' tab will appear in the Ninext window. Then, each time the debug() function of Ninox is executed, a new line will appear in the 'Debug Tracer' tab with multiple pieces of information, including the elapsed time since the display of the previous line. With this notion of elapsed time between two debug() executions, you should be able to calculate the time it takes for the columns to display.

      In the example below, the debug('test debug') function triggers the addition of a line with the value of the 4 variables a, z, c, and d. This example is present in the #Ninext 2 database, in the 'test debug' button of the Customer form.

      For your information, most of the time, it is a call to 'select' that causes time losses.

      As for NativeJS, it is necessary for the execution of DebugTracer. So if DebugTracer is set to True, NativeJS will be automatically loaded.

    • Jacques_TUR
    • 11 days ago
    • Reported - view

    Hello everyone,

    I've just released version 2.1.23.

    I've added two features:

    1 - Fields operations to duplicate, copy/paste, and delete using shortcut keys directly on the form (in admin mode):

    The idea is to easily replicate a field that you've spent time configuring, whether it's in the same table, another table, or even another database.

    This function is directly activated if you use the fieldsInspector option in the Ninext initialization settings.

    Duplicate: cmd+D (or ctrl+D)

    Duplicates the selected field and positions the new field right after it.

    Copy/Paste: cmd+C/cmd+V (or ctrl+C/ctrl+V)

    Copy the selected field (cmd+C), then select the field after which the new field will be pasted (cmd+V)

    Delete: Backspace (or Delete):

    Deletes the selected field without having to open the field editor and click the delete button. This is simply a time-saver.

     

    Copying a field from another table:

    If Ninext detects that the field comes from another table, it spontaneously offers to add at the header of every script present in the field, a copy of the original script in the form of a comment. This allows for comparing the original script and how Ninox translates it in the new environment of the copied field.

     

     

    2 - Call Ninox functions directly from an HTML component:
    This feature allows for creating interactions and value passing between HTML fields and Ninox dynamically.

    function test(message : text) do
        'Ninox text field' := "Good morning " + #{:text return prompt(message, 'nobody')}#
    end;
    html(---
      <button id='myButton' onclick='ninext.callNinoxFunction("test", this, "what your name ?")'>Push to try it</button>
    ---)
    function test(message : text) do
        'Ninox text field' := "Good morning " + #{:text return prompt(message, 'nobody')}#
    end;
    html(---
      <button id='myButton' onclick='ninext.callNinoxFunction("test", this, "what your name ?")'>Push to try it</button>
    ---)

     

    In this example, there are multiple interactions between Ninox and HTML/JavaScript. When the user clicks on the HTML button, the onclick event calls the ninext.CallNinoxFunction with the following parameters: the name of the function in the Ninox script, the HTML field, and one or more additional parameters that will be passed to the Ninox function. Here, only one additional parameter is passed, which is the text 'what your name'.

    In the "test" function, we assign to the Ninox field 'Ninox text field' the value returned by the JavaScript prompt function, which takes 'message' as its argument.

     

    I am attaching a sample application. Check out the NinoxCallBack table for the two formulas that return HTML fields that communicate with Ninox functions.

     

    I hope these two features will help you create applications more easily and with custom interfaces that use HTML/JavaScript when necessary and Ninox scripts whenever possible.

    Have fun ! 😄

      • Fred
      • 11 days ago
      • Reported - view

      You have been really busy. I know people have been asking for the field copy/duplicate function for a long time.

      Sadly, since Ninext is not officially supported it is hard for people to use it in a production environment.

      I can use Ninext to its full potential since I only have a private DB.

      • Jan_Augustin
      • 10 days ago
      • Reported - view

       

      Hello Fred,
      A few weeks ago I’ve started working with Jacques and we have discussed the topic of using Ninext in a production environment. I would like to take the opportunity to point out that in my opinion some elements of Ninext can be used in a production environment while others really must not be used.

      The difference is whether your code relies on Ninext to work in the future or whether you’re just using Ninext to make your life easier and the result of your activity will stand even in the case that Ninext goes away one day.

      The copy/paste functionality is a good example for something that can be used even in a production environment as long as Ninext is available. If Ninext goes away the copied fields will still be there - only copy/paste won’t be available any more in the future. Of course some additional quality control is advisable for a production environment whether the copied field is exactly created the way you want it to be.

      An example for the type of functionality in Ninext that you really don’t want to use in a production environment is from my perspective the simplified use of Javascript in Ninox-source (NativeJS). You’d be in real trouble in a production environment if Ninext goes away one day and your code doesn’t work anymore from one day to the other!

      We’ll be working on a documentation of Ninext in the coming weeks that will also point out to which of the two categories each functionality provided by Ninext belongs to - so that even in a production environment some of the Ninext functionalities can be used.

      • Fred
      • 10 days ago
      • Reported - view

      Funny, those were my thoughts (developer side vs. functionality side) after I clicked Reply. Look forward to the documentation.

      • Alan_Cooke
      • 10 days ago
      • Reported - view

       This is great - cannot wait to try it out

      • Icarus_Ralf_Becker
      • 3 days ago
      • Reported - view

      Hi Jacques, again amazing features you provide. I have one question: would it be possible to have the Copy&Paste function also for Buttons? Best, Ralf

      • Alan_Cooke
      • 3 days ago
      • Reported - view

       Hear, hear.  That would be amazing.

      • Jacques_TUR
      • 2 days ago
      • Reported - view

       ,  Thank you for your messages.
      I have just released version 2.1.24 which now allows you to copy layout fields.
      Also, if no field is selected when pressing cmd-v (ctrl-v), the field is copied first in the current tab.

      • Icarus_Ralf_Becker
      • 2 days ago
      • Reported - view

      absolutely amazing. Thank you very much 🙏

      • Alan_Cooke
      • yesterday
      • Reported - view

       What a wizard you are.  To be able to copy and paste makes life so much easier!!

    • Jacques_TUR
    • 21 hrs ago
    • Reported - view

    Hello everyone,

    I am releasing a patch that brings us to version 2.1.25. It fixes issues with copy/pasting

    Fixed :

    • Various malfunctions in copy/pasting. When entering text, pressing the 'delete' key prompts a field deletion confirmation window. 
    •  Even if the window is confirmed, no field is deleted. However, it is not possible to delete the text that is being entered. 
    •  After copying a field and moving to enter text in another field, performing a 'copy' will add the field at the top of the page instead of copying the text. 
       

Content aside

  • 11 Likes
  • 21 hrs agoLast active
  • 141Replies
  • 2898Views
  • 29 Following