9 Replies Latest reply on Jun 15, 2019 12:11 AM by tdobe

    Interactive Grid with autosave

    tdobe

      hi,

       

      I need Interactive Grid with autosave after change any cell...

       

      Does anyone know how to do something like that?

       

      TT

        • 1. Re: Interactive Grid with autosave
          Jorgelina1

          Hi...

           

          I believe there is an event for when data is changed... If not you would have to set some jscript code to check every  "5 secs" to check if the model has changed and then do whatever you want.

          However... I do not think would be performing, if every 5 seconds it has to go to the server to save data...

          Is there a reason why you would need to do this saving every time a cell changes a value? Because in a text box, if you want to type "active", just by typing the "a" you are changing it, and the grid would be saved and you would have to again click on the cell to edit... I am not aware if there is some sort of "lost focus" event per cell, but I am not sure your best option is to go and save automatically every N seconds the grid... will be a headache.

          So, maybe you could think on another type of solution that would help you? Maybe if you tell us what is exactly the problem you need to tackle?

          • 2. Re: Interactive Grid with autosave
            tdobe

            I need to have such functionality as, for example, in excel, if we fill one cell, the rest will be calculated (if modified by the modified cell). for example.

             

            COL1    COL2    COL3  

               2            3           5

             

            column 3 is calculated on the basis of COL1 + COL2 (in SQL), and I want to see this modification after pressing ENTER or leaving the cell (as in Excel)

            • 3. Re: Interactive Grid with autosave
              tdobe

              I need to have such functionality as, for example, in excel, if we fill one cell, the rest will be calculated (if modified by the modified cell). for example.

               

              COL1    COL2    COL3  

                 2            3           5

               

              column 3 is calculated on the basis of COL1 + COL2 (in SQL), and I want to see this modification after pressing ENTER or leaving the cell (as in Excel)

              • 4. Re: Interactive Grid with autosave
                John Snyders-Oracle

                Hi,

                 

                What you are asking for, autosave, makes sense but is currently not possible. See Interactive Grid - Save 1 row

                 

                But auto save is overkill for what you are trying to do. What would you do if COL1, COL2, and COL3 were page items?

                Create a DA on COL1, COL2 that gets the value of each does the math and sets COL3.

                And you would redo the calculation on the server when the page is submitted because you can't trust the client.

                To do the same with IG give columns COL1, COL2, and COL3 static IDs so you can use them in DAs. I recommend a "C_" prefix ex: C_COL1, C_COL2, C_COL3.

                To redo the calculation on the server use Target Type: PL/SQL code in the IG DML process.

                 

                Regards,

                -John

                • 5. Re: Interactive Grid with autosave
                  tdobe

                  hi, COL1... COL3... are columns in the grid, not items;)

                   

                  Maybe someday they will do autosave ... I hope so.

                   

                  thx.

                  • 6. Re: Interactive Grid with autosave
                    Jorgelina1

                    What John is trying to tell you is that on these column you can set a DA (as you do on external items), using their static IDs (that is why he tells you to use C_COL01 for COL01), and trigger some onchange, and when this happens, do the calculation through pl/sql if you must, on your DA, to then enter that value on C_COL03 if you must.

                    This means some coding in jscript/jquery in order to get the right event that will satisfy your need, to then do the calculation.

                    Does that make sense ?

                     

                    Regards.

                    1 person found this helpful
                    • 7. Re: Interactive Grid with autosave
                      tdobe

                      It makes sense, but you have to press the "SAVE" button ...

                      • 8. Re: Interactive Grid with autosave
                        Jorgelina1

                        As per what you have stated is your need, you could set a DA on lost focus/change on your cell (I believe lost focus will be better than onChange, but you should check it just in case), but on that DA, a jscript function should do the math you need and place it on the cell you need... all this is possible. You do not have to press the save button for this.

                        Now, once you want to save your changes, you do redo the math for the 3rd cell, just to make sure is correct. There are ways to have a "readonly" cell in grid, and be able to change the values through jscript, but not the user.

                         

                        On the other hand, you could, if you wanted, on a DA on cell lost focus or onchange, force the grid to save, it is absolutely possible... But I do not think would be recommended at all, the processing overhead will produce would make it not performing at all... The Interactive Grid is a powerful tool for doing lots of things, but I am not sure is quite there to be an xls sheet replacement.

                         

                        Regards.

                        • 9. Re: Interactive Grid with autosave
                          tdobe

                          do not need an excel, I need autosave ... but I understand that it just does not exist.