17

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.

230 replies

null
    • NYNNA
    • Louis_Cornacchia
    • 1 yr 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?

      • Ninox developper
      • Jacques_TUR
      • 1 yr ago
      • Reported - view

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

    • Ninox developper
    • Jacques_TUR
    • 1 yr 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 yr 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
      • 1 yr 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.

      • Ninox developper
      • Jacques_TUR
      • 1 yr 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.

    • Ninox developper
    • Jacques_TUR
    • 1 yr 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
      • 1 yr 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
      • 1 yr 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
      • 1 yr ago
      • Reported - view

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

      • Alan_Cooke
      • 1 yr ago
      • Reported - view

       This is great - cannot wait to try it out

      • Icarus_Ralf_Becker
      • 1 yr 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
      • 1 yr ago
      • Reported - view

       Hear, hear.  That would be amazing.

      • Ninox developper
      • Jacques_TUR
      • 1 yr 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
      • 1 yr ago
      • Reported - view

      absolutely amazing. Thank you very much 🙏

      • Alan_Cooke
      • 1 yr ago
      • Reported - view

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

      • Fred
      • 1 yr ago
      • Reported - view

      Sadly paste from another table does not just work in a Page. Nothing happens. If I go to a regular table it pastes fine. Copy within a Page or to another table doesn't work either. I'm sure you are working on it.

      • Ninox developper
      • Jacques_TUR
      • 1 yr ago
      • Reported - view

       I've already corrected the problem. I think I'll be able to do an update on Monday or Tuesday. Thank you for your patience.

      • lime_owl
      • 1 yr ago
      • Reported - view

      I have only recently found out about the Ninext Project and read all of the posts in this topic. Your post answers a lot of the questions that I came up with.

      What I still don't get: Is there any way for me to copy the code of the copy/paste function to be able to use it in my existing DB?

      Or is the only option to take an "empty" ninext DB and import my existing DB (production environment) and only use the functions that are okay to be used in the production environment?

      Many thanks in advance

      • Jan_Augustin
      • 1 yr ago
      • Reported - view

       Hello, you can use Ninext with an existing DB as well. Please message  to obtain a detailed description on how to set it up! - see this message from Jacques on how to proceed: https://forum.ninox.com/t/m1h0b4d?r=q6ha3gt.

    • Ninox developper
    • Jacques_TUR
    • 1 yr 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. 
       
    • Ninox developper
    • Jacques_TUR
    • 1 yr ago
    • Reported - view

    Hello, 

    I just released version 1.2.26 beta of Ninext with the following fixes:

    • Fixed: error occurred when callNinoxFunction is called with an object as a parameter. September 29, 2023
    • Fixed: copy/paste, if a popup is displayed, copying is not taken into account because Ninext thinks there is an ongoing input window.
    • Fixed: copy/paste doesn't work with Page.
    • Fixed: Copying a relationship field (1:N or N:1) to another table does not create the reverse link in the other table. Now copying this type of field is prevented.
      • Ninox developper
      • Jacques_TUR
      • 1 yr ago
      • Reported - view

      - Fixed: Sometimes, copy/pasting between two applications doesn't work. 

      • Fred
      • 1 yr ago
      • Reported - view

      Jacques TURI tried the copy/paste from table to Page and I can't get it to work. See attached video.

      Screen Recording 2023-10-09 at 9.11.36 AM

      Am I missing something?

      Did a bit more testing and it works in records in a table, but not in my dashboards or Page. I can't copy a field in a dashboard and paste in the same dashboard or to a Page. I can copy/paste when I go into a record in a data table.

    • Ninox developper
    • Jacques_TUR
    • 1 yr ago
    • Reported - view

    I am really sorry 😔.

    Several of you are having issues with the copy/paste function not working in certain configurations, or not working at all. I had tested it on Chrome, Safari, and Firefox on Mac, and on Chrome and Firefox on PC, and everything was working fine 🤔.
    Following your messages, I looked into what could be causing the issue and found some flaws that might work for certain browser configurations but not for others. I hope this is the root of the problem because, unfortunately, I have not been able to reproduce the issue so far.

    I have just released version 2.1.27 beta and hope that this will fix your problems.

      • Fred
      • 1 yr ago
      • Reported - view

      I tested it out in a copy of the Ninext db you have posted and it works fine copy/paste from a table to a Page. But copy/paste doesn't work if I have a dashboard with no table view.

      I tried it in another DB and I am able to copy/paste from a table to a Page, but not from a no table view dashboard to a Page. In the workspace I invited you too the DB is called Baseball. So you can try it out as well.

      If I add a table view to my dashboards then I can copy/paste to and from the single record in the table. So could there be something with not having a table view in your DB?

Content aside

  • 17 Likes
  • 3 wk agoLast active
  • 230Replies
  • 5374Views
  • 38 Following