Jump to content

abiery_iqms

uniGUI Subscriber
  • Posts

    14
  • Joined

  • Last visited

Posts posted by abiery_iqms

  1. The resolution here was to move the restoration of the filter values to the "OnReady" ExtEvent. 

     

    Steps:

    In the ClientEvents => ExtEvents on the TUniDBGrid, I added a beforerender event listener

    1.  Added onbeforerenderenvent:

    function beforerender(sender, eOpts)
    {
      ajaxRequest(sender, "OnReady",[]);
    }
     

    2. On the TUniDBGrid OnAjaxEvent handler, added the following code:

     
    procedure TIQWebDBGrid.UniFrameAjaxEvent(Sender: TComponent; EventName: string;
      Params: TUniStrings);
    begin
      if CompareText(EventName, 'OnReady') = 0 then
      begin
        if RememberColumnFilters then
          Grid.RestoreSavedFilters;
      end;
    end;
    

    I hope this is a help to somebody.

  2. I've gotten one step further in this process - storing/restoring filter values is working by using the VarValue, and by moving the filtering code outside of the event handler and simply calling it in two places.  The last part is the values are not displaying in the TUniEdits above each column.  When I inspect the fields while debugging they do indicate they have values in them when VarValue is updated - is this simply a UniSession.Synchronize issue?  I apologize if I'm asking foolish questions - it just doesn't seem to be quite working yet.

  3.  

    i do what you want to do. for this i save filter value in database.

     

    For restore value in filter:

    GridAO.Columns[j].Filtering.VarValue:=getSavedFilterValueForColumn(i);

     

    And Afterrestore i call a procedure for apply filter value to dataset (see http://forums.unigui.com/index.php?/topic/9283-sorting-filtering-issue/&do=findComment&comment=47993 )

    This procedure is also call in oncolumnfilter but i fired oncolumnfilter only when the filter is changed by user

     

    I've gotten one step further in this process, and my filters are getting stored and restored.  However, simply setting the VarValue isn't getting the values back in to the filter TUniEdits.  Does that have to be done manually by setting the text property?

    
    
  4. Hi everyone,

     

    Is it possible to set filter values on a TUniDBGrid at run-time using code?  If so, could you please give me a simple example?  I tried doing this, but it doesn't appear to do anything.  I also need to fire the OnColumnFilter event after I set the value.

     

    The reason I am doing this is to restrore the state of the grid when a user enters a filter value, it needs to be remembered the next time the user opens the grid.  Is this something you can use the ExtJS stateId property with? http://docs.sencha.com/extjs/6.0.1/classic/Ext.grid.Panel.html 

    procedure TIQWebInternalDBGrid.RestoreSavedFilters;
    var
      i : integer;
    begin
      if not IsDataSetActive then
        Exit;
    
      for i := 0 to Columns.Count - 1 do
        begin
          if Columns[i].Filtering.Enabled then
          begin
            if IsFilterable(Columns[i].Field, 'A' {Columns[i].Filtering.VarValue}) then
            begin
              Columns[i].Filtering.PrevValue := 'triggertheevent';
              Columns[i].Filtering.VarValue  := 'A';
            end;
          end;
        end;
    end;
    

    Thanks in advance!

  5. Hi all,

     

    Is it possible to add a mailto: tag directly to a TUniLabel?  Ideally, I would like a component that works similarly to a TUniLabel, where the caption would be the recipient email address and I could set properties for subject, and body of the message.

     

    I know, I may be asking for a lot.  Has anyone done something like this?  Using a TUniURLFrame for a simple mailto seems rather clumsy.

  6. Thank you.  To summarize for posterity...

     

    TUniDBGrid needs:

    1) Options := Options + [dgFilterClearButton]; Shows the clear all button

    2) A UniHiddenPanel to hold the filter edits - this needs to have a parent assigned and coexist with the TUniDBGrid.  Creating a descendant of TUniDBGrid which instantiates a TUniHiddenPanel within the class will prevent the javascript events from getting hooked up (X's in fields  & clear all button won't do anything)

    3) OnClearFilters event assigned

    4) OnColumnFilters event assigned

     

    To enable/disable incremental search vs. waiting for use to initiate searches, use CharEOL.  Date fields automatically trigger after a date is selected.

     

    Wait for prompt:

    (*Tells the grid to wait for user to press enter before filtering*)'
    TUniEdit(aSearchField).CharEOL := #13;
    TUniEdit(aSearchField).CharEOLEventType := ceKeyDown;
     

    For incremental searches, no EOL is used.

  7. Hello,

     

    It appears that filtering using TUniDBGrid doesn't work if the TUniDBGrid resides on a TUniFrame.  I've modified the GridFiltering-2 example to demonstrate this and attached the folder.  

     

    Observed problem: Filtering functionality no longer triggers when the TUniDBGrid is inside a TUniFrame.  The user enters a value to filter with, presses enter, and nothing happens.

     

    Is this a bug?  Is there a way to make this work? Please let me know.

    FilteringExample.zip

  8. @Delphi Developer

     

    This was a mistake on my part.  I went to the columns property on the TUniDBGrid and inside of the field editor, I used the "Add All Fields" button and they all appeared at run time.

    Thanks for your help and your patience with my silly question!

  9. Hi all,

     

    Allow me to apologize in advance if I am posting in the wrong topic, or this question has already been answered.

     

    I have the following setup

     

    TDataSource

    TDataSet

    TUniDBGrid

     

    I set the TDataSource.TDataSet property to be my dataset (a TFDQuery with 70+ columns in the fields editor)

    I then set TUniDBGrid.DataSource property to be my DataSource.

     

    At run-time, my TUniDBGrid populates, and columns are shown.  However, it only shows the first 7 instead of every field in the TDataSet Fields Editor.

     

    Is this by design?  Surely there can't be a hard-coded limit of 7 columns in a TUniDBGrid...  I scroll all the way over and still, only 7 fields display.  

     

    Please point me in the right direction?  Thanks in advance!

×
×
  • Create New...