Jump to content

eduardosuruagy

uniGUI Subscriber
  • Posts

    831
  • Joined

  • Last visited

  • Days Won

    10

Posts posted by eduardosuruagy

  1. Hi,

     

    I couldn't reproduce your issue, it seems that you have active control at the end

     

    If I understand you correctly, can you try this approach for now ?!:

     

    1. UniScrollBox1 -> ClientEvents -> UniEvents -> function beforeInit:

    function beforeInit(sender, config)
    {
        config.autoScroll=false;
    }

    2. MainForm -> OnReady event:

    procedure TMainForm.UniFormReady(Sender: TObject);
    begin
      UniScrollBox1.JSInterface.JSCall('setAutoScroll', [True]);
    end;

    Best regards,

     

    Unfortunately it did not work

  2.  

    I had already tried these options yesterday, but they all make mistakes. The errors are these:

     

    Cannot read property 'scrollTo' of undefined
     
    procedure TMainForm.UniFormCreate(Sender: TObject);
    begin
      UniSession.AddJS(UniScrollbox1.JSName+'.body.scrollTo(''Top'', 0, true);');
    end;
     
     
    ---
     
    Cannot set property 'scrollTop' of null
     
    procedure TMainForm.UniFormCreate(Sender: TObject);
    begin
      UniSession.AddJS('document.getElementById("'+UniScrollBox1.JSName+'_id-body").scrollTop = 0;');
    end;
  3. I'm sending another example so you can see what happens. When you edit the Address column onwards, it says exactly what you did, but when it arrives in the Cep column and gives an Enter, even without making any changes to the registry, the system cancels the changes that were made in the previous columns. Another problem I noticed was when I am in the last line and in the last field and I click on enter and the system does not execute any view of ClientDataSet. When I'm in the last column I give the enter in the ClientDataSet in the AfterPost event I give an ApplyUpdates (0).

    Grid - DbGrid Editavel.rar

  4. Hi,

     

    Can you try this approach ?!:

    function reconfigure(sender, store, columns, oldStore, oldColumns, eOpts)
    {
        var grid = sender;
        function fn() {
            var selModel = grid.getSelectionModel();
            var _row = selModel.getCurrentPosition().row;
            var _col = selModel.getCurrentPosition().column;
    
            if (grid.columnManager.columns[_col].isLastVisible) {
                _col = 0;
                _row += 1;
            } else {
                _col += 1;
            };
    
            setTimeout(function() {
                grid.getSelectionModel().select({
                    row: _row,
                    column: _col
                });
                grid.editingPlugin.startEdit(_row, _col);
            }, 10);
        };
    
        for (var i = 0; i < columns.length; i++) {
            var hasEditor = columns[i].getEditor();
            var ed = hasEditor || columns[i];
    
            if (columns[i].checkColumn) {
                columns[i].on('keydown', function(a, b, c, d, e) {
                    if (e.getKey() == 13) {
                        fn();
                    }
                })
            } else if (columns[i].rdonly) {
                ed.on('keydown', function(a, b, c, d, e) {
                    if (e.getKey() == 13) {
                        fn()
                    }
                })
            } else {
                ed.on('specialkey', function(field, e) {
                    if (e.getKey() == 13) {
                        fn();
                    }
                })
            }
        }
    }

    Best regards,

     

    It worked perfect, congratulations for the great work of you, that's why I bought the tool, besides being great, also has a great support. Thank you!!

  5. First, don't use direct queries especially in SQL Server.

    Create stored procedure with filtering parameters, your Delphi client will be calling it

    exec sp_proc1 :PRO_RAZAO_SOCIAL, :LOG_UF, :LOG_CIDADE

     

    Test in Manager Studio with some parameters and make sure it returns data, then pass the same params from Delphi. Your issue is probably caused by wrong parameters you are trying to filter with, not because of UniGui. Since you are using LIKE, maybe you forgot to prepend or append % depeding on how you want to match the data.

    Open the C: \ Program Files (x86) \ FMSoft \ Framework \ uniGUI \ Demos \ Desktop \ GridFiltering project then open the database and add a new record and leave that field blank, then see that it is not shown On the grid when it runs.
  6. If I am editing the first line of the grid it does nothing, I give enter but nothing happens. If it's the second line it edits and jumps to the next field. When I am in the last field and press enter it jumps down the line being that it is in the last column, it should go to the first column.

  7. Open the C: \ Program Files (x86) \ FMSoft \ Framework \ uniGUI \ Demos \ Desktop \ GridFiltering project then open the database and add a new record and leave that field blank, then see that it is not shown On the grid when it runs.
  8. This is similar to the other when it goes to the next field it is already in the editing state. Do a test on a grid with no record and try to include a new record using this function you showed, see that when it arrives in the last column it does nothing, neither the tab nor the enter work...

  9. I wanted this method as it was made to jump from the line in line and jump from column to column and when it reached the last column jumped to the next line, understood?

     

    function reconfigure(sender, store, columns, oldStore, the, eOpts) {
        var grid = sender;
        for (var i = 0; i < columns.length; i++) {
            if (columns.getEditor()) {
                columns.getEditor().on('specialkey', function(field, e) {
                    if (e.getKey() == 13) {
                        var store = grid.getStore();
                        var selModel = grid.getSelectionModel();
                        var selectedRecord = selModel.getLastSelected();
                        var recordIndex = store.indexOf(selectedRecord);
                        var nextRecord = store.getAt(recordIndex + 1);
                        
    if (nextRecord) {
                            selModel.select(nextRecord);
                            if (grid.editingPlugin && grid.uniRow && grid.uniCol){
                              var _row = grid.uniRow;
                              var _col = grid.uniCol;
                              setTimeout(function(){
                                grid.editingPlugin.startEdit(_row, _col);
                              }, 10);
                            }
                        }
                    }
                })
            }
        }
    }
×
×
  • Create New...