Jump to content

arilotta

uniGUI Subscriber
  • Posts

    187
  • Joined

  • Last visited

  • Days Won

    3

Posts posted by arilotta

  1. Hi, I'm trying to achieve the grid indicator feature by adding as the first column and image showing a triangle that resembles the well known standard Delphi 

    grid indicator.

    The problem I am facing here is that it has to be shown only on the selected row, while it should be hidden for all the other rows.

    Ideas on how to achieve this ?

    Thanks

  2. Hello,

    even though I enable the dgIndicator in UniDbgrid, and the relative column column is added, at runtime I don't see any indicator.

    Am I missing something ?

     

    Thanks

    Andrea

  3. Yes, that's the idea, and it works as you would expect in a mobile browser. No difference between a FireMonkey app with TWebBrowser component and Chrome mobile browser.

    Regarding the login form, I use a TUnimLoginForm form.

    Then if from the main form you specify "ModalResult:=mrOk;" you'd go back to login form. It works perfectly, as in the mobile browser.

  4. I'm unable to open a unigui mobile site from a FireMonkey app using the TWebBrowser component, I always get


    "Invalid session or session timeout. restart Application".


     


    If I open the website from a mobile browser (Chrome) everything works smoothly.


     


    Is there something I'm missing ?


     


    Thanks


    Andrea Arilotta


  5. First of all, I apologize for posting to this group, uniGUI Mobile is more appropriate but unfortunately I'm not allowed to add posts to that group...

    Is there any reason ? I've bought the complete version...

     

    Now, the issue. I'm unable to open a unigui mobile site from a FireMonkey app using the TWebBrowser component, I always get

    "Invalid session or session timeout. restart Application".

     

    If I open the website from a mobile browser (Chrome) everything works smoothly.

     

    Is there something I'm missing ?

     

    Thanks

    Andrea Arilotta

  6. Thank you Delphi Dev,

    it works using the "selectPathById" function. It is necessary to know in advance the node ID, and it is somehow tricky to get that value.

    However I managed to get that value directly from the query (using Oracle). For anyone that's interested in, the node index ranges

    from zero to N-1 (number of nodes minus 1).

    The first root node gets a 0 index, the second root node a 1 index, ...

    The first node at level 1 (child of a root node) gets a J index, given J the number of root nodes, and so on

    Maybe clearer with an example:

     

    N1                                                               Index 0

             N11                                                    Index 3

             N12                                                    Index 4

    N2                                                               Index 1

             N21                                                    Index 5

             N22                                                    Index 6

    N3                                                               Index 2

             N31                                                    Index 7

                         N311                                      Index 9

                         N312                                      Index 10

             N32                                                    Index 8

  7. Ok, I shared the tets case on Google Drive. Please download the test case from the following link:

     


     

    Steps to reproduce the issue:

    1. Click "1. Fill dataset" to populate the dataset

    2. Click "2. Locate root" to move the active record to the root

    3. Click "Expand Selected Node" to expand it --> it works

     

    4. Click "FullCollapse"

    5. Click "3. Locate Child1" to move the active record to Child1

    6. Click "Expand Selected Node" to expand it --> doesn't work, nothing happens

     

    Repeat steps 4..6 changing the node to locate, locating GrandChild1 and then GrandChil3:

    same behaviour the node is not made visible.

     

    If I change "cascadeBy" with "bubble", strangely, the behaviour is the same.

     

    Thank you
  8. Thank you, after analyzing the link you've posted, I find a solution, I'm posting it here just in case anyone has the same problem:

     

    ----------------------------------------------------------------

     

    In main form:

     

    MyForm.Initialize(..., ...)

     

    In MyForm:

     

    procedure TMyForm.UniFormCreate(Sender: TObject);
    begin
      // form initialized as not visible
      self.ClientEvents.ExtEvents.Add
          ('window.afterlayout=function afterlayout(sender, layout, eOpts)'+
          ' {  Ext.get(sender.id).el.setVisible(false); }');
    end;
     

    procedure TMyForm.Initialize(..., ...);

    begin

      try

        // form initialization...

        raise Exception.Create('some error');

        ShowModal;

        UniSession.AddJS('setTimeout(function(){'+self.WebForm.JSName+'.el.setVisible(true); }, 0)' );

      except

        TMRClose.Enabled:=true;

        self.Close;

      end;

    end;

     

    procedure TMyForm.TMRCloseTimer(Sender: TObject);

    begin
     // TMRClose is a TUniTimer with Interval=1, RunOnce=true
      self.Close;
    end;
  9. Thank you, your solution fully expands a branch from a starting node, but I need to go up the tree and expand the parents rather than the children.

    On the Sencha documentation, I found the function "bubble" that should do the trick.

    Unfortunately, if I substitute "cascadeBy" with "bubble" and an hidden node is selected, it doesn't work.

    Let me explain a bit more my problem.

    I have a hierarchical query bound to a TUniDbTreeGrid; when I open the form the tree is fully collapsed; then I change the

    active record on the query by code using a Locate. If the new active record is not on the root level, and it is a child, and the tree

    is collapsed, I need that node to be expanded, in order to have the selection visible.

    I really appreciate the time you are spending with me.

    Thanks

     
  10. Hi,

    using VCL I usually create a form and initialize it calling a "startup" method; thsi method is repsonsible to set up the form, open 

    the queries and finally display the form. During that phase, if an exception is raised implicitely or explicitely, the relative message

    is shown to the user and the form is not shown.

    Something like this:

     

    with TMyForm.Create(self)

    try

      Initialize(.., ...);

    finally

      Free;

    end;

     

    procedure TMyForm.Initailize(..., ...);

    begin

      // form initialization...

      raise Exception.Create('some error');

      ShowModal;

    end;

     

    In the above example, the form is created, the Initailize method is executed until the exception, finally the form is freeid.

     

    I'm unable to achieve the same behaviour with UniGUI, as it seems that the forms are automatically shown after being created.

    I've tried something like this, but it gives a Javascript error:

     

    procedure TMyForm.Initailize(..., ...);

    begin

      try

        // form initialization...

        raise Exception.Create('some error');

        ShowModal;

      except

        self.Close;

      end;

    end;

     

    Is there a solution ? Or, which is the best way to initialize a form ?

     

    Andrea

  11. Hi, I've tried the 2nd solution, and it works, but I would like to expand the branch all the way up starting from the selected node.
    The supplied code expands just the selected node.
     
    I've tried somethign like this, trying to get the parent node, and expand it, but it didn't work:
     

    function beforeInit(sender, config)
    {
        var me = sender;
        me.expandSelectedNode = function() {
            var _selection = me.getSelectionModel().getSelection()[0];
            if (_selection) {         
              var _parent = _selection.get('parentNode');
              if(_parent) {           
              _parent.set('expanded', 'true');

              };
            };          
        };
    }

  12. Hi, I know it is possible to fully expand/collapse a UniDBTreeGrid.

    What I'm trying to achieve is to only expand the branch that contains the selected record.

    Looking at Sencha documentation, it seems there is the "expand" method, so I've tried something like this:

     

    UniDBTreeGrid1.JSInterface.JSCall('expand', ['key id', true]);

     

    Unfortunately, it doesn't work. Any ideas ?

×
×
  • Create New...