Jump to content
uniGUI Discussion Forums

arilotta

uniGUI Subscriber
  • Content Count

    157
  • Joined

  • Last visited

  • Days Won

    2

Posts posted by arilotta


  1. Your solution works well Delphi developer.

    I use some images in a DbGrid as action icons, and I need to know the position of the mouse when the image gets clicked (left mouse button)

    because I need to popup a popupmenu with some choices in that position.

    In fact this solution gives me back the coordinates of the cell, and not the actual coordinates of the mouse.

    I would need to have the X,Y coordinates such as in the OnCellContextClick event.

    Why the OnCellClick event does not supply X,Y coordinates ?

     

    As always thank you.


  2. Thanks alot Delphi dev,

    I started yesterday following Mohammad's instructions finding the CSS styles to modify, and I managed to achieve something 

    using these:

     

    .x-grid-row-before-focused .x-grid-td {
      border-bottom: 1px hidden #FFFFFF;
    }
     
    .x-grid-row-focused .x-grid-td {
      border-bottom: 1px hidden #FFFFFF;
    }
     
    .x-grid-body .x-grid-table-focused-first {
      border-top: 1px hidden #FFFFFF;
    }

     

    But your solution works in fact very well and I'll use your style.

    I'm planning to use this solution with the grid indicator (remember the other post ?)

    In addition, thanks to your reply, I learnt how to apply a particular style (custom-grid in our case) to a specific grid,

    using the beforeInit event. 

    Thanks again !


  3. Hi Farshad, I needed too to know the position of a clicked cell.

    It seems that this solution does not work anymore, maybe the framework has changed meanwhile.

     

    function cellmousedown(sender, td, cellIndex, record, tr, rowIndex, e, eOpts)
    {
      var c = sender.getXY(e);
    alert("c.x"+c.x);
    }
     
    the above implementaion returns "undefined", which is the correct way to get the coordinates ?
    Thank you

  4. 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


  5. 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


  6. 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.


  7. 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



  8. 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


  9. 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


  10. 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

  11. 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;

  12. 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

     

  13. 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

×