Jump to content

gerardocrisci

uniGUI Subscriber
  • Posts

    177
  • Joined

  • Last visited

  • Days Won

    7

Posts posted by gerardocrisci

  1. The problem exists ...
    but you can evaluate .. before the components are created

    rate this test

    procedure TMainForm.UniFormCreate(Sender: TObject);
    begin
      
      UniDBGrid1.Columns.Delete(2);  // before starting the data request .. the associated field will not be asked
        
      UniBitBtn1.Free; // it appears that the button is created ... but not combined with the click
      
    end;
      

    try and see if it's okay.

  2. maybe you can use this example of mine..

    I created you a generic procedure (GetLocalStorage) that shows you all the values of localStorage
     and waits to read them in UniFormAjaxEvent.

    the procedure is started when the form is ready .. but you can also call it at the click of a button ..

    object MainForm: TMainForm
      OnReady = UniFormReady
      OnAjaxEvent = UniFormAjaxEvent
    type
      TMainForm = class(TUniForm)   
    
        procedure UniFormReady(Sender: TObject);
        procedure UniFormAjaxEvent(Sender: TComponent; EventName: string;
          Params: TUniStrings);
      private
        { Private declarations }
        FLKey: string;
      public
        { Public declarations }
         procedure GetLocalStorage;
      end;
    
    procedure TMainForm.GetLocalStorage;
    begin
      UniSession.AddJS(
        ' var p = [], keys = Object.keys(localStorage), i = 0, key; '+
        ' for (; key = keys[i]; i++) { p.push( key + "=" + localStorage.getItem(key)); } '+
        ' ajaxRequest(MainForm.window, "getKey", p); '
      );
    end;
    
    procedure TMainForm.UniFormReady(Sender: TObject);
    begin
      FLKey:='';
      GetLocalStorage;
    end;
    
    procedure TMainForm.UniFormAjaxEvent(Sender: TComponent; EventName: string;
      Params: TUniStrings);
    begin
      if EventName = 'getKey' then
      begin
        FLKey := Params.Values['lKey'];
        UniMemo1.Text := Params.Text; // <---- read all values
      end;

    I hope you find it useful ..

  3. 19 minutes ago, Farshad Mohajeri said:

    This ticket is already reviewed and replied.

    Initially I asked to consider OnGetText () for cell formatting ...
    later .. you created the ForceStringFormat property ..
    Now I don't understand why at that point
    .. there is a check on OnGetText and not on ForceStringFormat.

    The right check would be to check if the Field has a DisplayFormat set ... but I can do this with an override for GetForceStringFormat.

    I would like to give suggestions ...
    if you don't want them ...
    thanks anyway.

  4. For a better management of the string format of the field .. I ask you if it is possible to have this modification

    function TUniCustomDBGrid.GetCellData(const ColNo: Integer; var HasAttr: Boolean): TUniCellRecord;
    ...
         else
          begin
    //        if Assigned(AField.OnGetText) then
            if wColumn.ForceStringFormat then 
            begin
              if RawData then
                rValue := StrToJS(AField.DisplayText)
              else
                S := StrToJS(AField.DisplayText);
            end
            else
            begin

    to change  " if Assigned(AField.OnGetText) then" in   " if wColumn.ForceStringFormat then " for me it's important
    Grazie

  5. In the meantime .. I put a patch like this

    procedure TUniCustomDBGrid.JSEventHandler(AEventName: string; AParams: TUniStrings);
    var
      AStart, APage, ALimit : Integer;
    begin
      inherited;
      if AEventName = UNI_DATA_EVENT then
      begin
        if not (dgPersistentSelection in FOptions) then
          FBookmarks.Clear;
    
        if FDelayBeboreLoad and FFirstLoad then Sleep(500);
        FFirstLoad := False;
    
        ALimit:=AParams['limit'].AsInteger;
        if FBufferedStore.FEnabled then
        begin
          APage  :=StrToIntDef(AParams['page'].AsString, 1)-1;
          AStart := APage*ALimit;
        end
        else
          AStart := StrToIntDef(AParams['start'].AsString, -1);
        HandleData(
          AStart,
          AParams['limit'].AsInteger,
          AParams['options'].AsInteger,
          AParams['sort'].AsString,
          AParams['group'].AsString
        );
      end;
    end;

     

    • Like 1
  6. I think the answer is in this discussion ...

    Quote

    Farshad Mohajeri said:

    This is a client side exporter developed by Sencha, so it can only export the visible page.

    If your grid is paged and you need to export all pages you must use a server side exporter such as FlexCell.

    Also you can switch to a non-paged grid.

  7. in unit uniBasicGrid;
    TUniGridExporter.ExportGrid 
    to correct the line in

      JSConfig('filename', [FFileName + '.' + Self.FExporter.FileExtention], ExpCfgObj);
    
      JSConfig('fileName', [FFileName + '.' + Self.FExporter.FileExtention], ExpCfgObj);

    n -> N

    please .Farshad Mohajeri ... for me you can also add this code

    TUniGridExporter = class(TPersistent)
      private
        function FileNameIsStored: Boolean;
        function TitleIsStored: Boolean;
        ...
      published
        ...
        property FileName: string read FFileName write SetFileName stored FileNameIsStored;
        property Title: string read FTitle write SetTitle stored TitleIsStored;
      end;
    
    function TUniGridExporter.FileNameIsStored: Boolean;
    begin
      Result := FFileName <> 'Export';
    end;
    
    function TUniGridExporter.TitleIsStored: Boolean;
    begin
      Result := FTitle <> 'Exported Grid';
    end;

    so as not to store the two values in dfm
    thank you

     

    • Like 1
  8. I have a question about the TITLE meta tag.
    because you only have to set it from TUniServerModule.title
    it is possible when it is empty
    to be able to set it but CustomMeta?

    Grazie

  9. Ciao Sherzod

    in unit uniDBGrid

    procedure TUniCustomDBGridColumn.InitFilter(C: TJSObject; Fld: TField);
    
            (FEdit as IUniFormControl).ClearButton := True;
    
            TUniControlHack(FEdit).LayoutConfig.Width := '95%';

    I think it's a solution is to create a property in Column.Filtering or generic .. like UseEditorClearButton stored false

    if NOT UseEditorClearButton then
     (FEdit as IUniFormControl).ClearButton := True;

    another block to consider a modification is the width property, I would modify the code in

    if TUniControlHack(FEdit).LayoutConfig.Width='' then
      TUniControlHack(FEdit).LayoutConfig.Width := '95%';

    Grazie

  10. Ciao Farshad Mohajeri
    I thank you for the answer..

    I understand ,
    creating a synchronized with the server is difficult ..
    in fact, I asked:

    20 hours ago, gerardocrisci said:

    Is this difficult to implement for at least non-editable grids? 

    to have a grid that displays data like the extjs example.
    And I asked if anyone had tried to do it ...and I asked for help
    (I didn't ask for someone to write a solution overnight :biggrin:)

    I do not accept that there is a difficulty to overcome and it will not be solved. Then she is postponed for a year.

    1 hour ago, Farshad Mohajeri said:

    so no more investment is needed if you have a valid subscription

    Paying the cost of UNIGUI is not the difficulty (in fact I manage 2 licenses)
    .. who more than me believes in this Framework

    long life to UniGUI!

    But consider this:
    if a customer asks me: "the application must adapt to the device"
    I see your roadmap .. and I read "Responsive Layout" expected in Q1 / 2020
    .. then I communicate the realization times to the customer ..
    if this is not done .. before 2021 ... i have a dissatisfied customer.

     

    My question remains:
    has anyone tried to recreate the example of extjs .. can you help?

     

    • Like 2
  11. Hi
    can your attempts be published?
    As we read in the buffered-store.js file:
    "This particular service cannot sort on more than one field, so if grouped, it disables sorting."
    I (and many) don't need it.

    You need the bare minimum to view a large number of records ... this is a big problem that extj has solved with this example.

     

    :)I thank you for your work ...
    but I cannot avoid highlighting :o:

    17 minutes ago, Hayri ASLAN said:

    Long-time ago we started to develop it but because of the problems, we stopped. Buffered property comes from those days.

    reading this statement is disheartening! It was expected in Q1 / 2019 now we are in Q1 / 2020. .. a year without a solution
    (maybe .. it was better to write "we have not yet evaluated this point")

    I have invested in you for 5 years now ... with 2 licenses ..
    .. and while paying the more expensive version .. don't provide all your sources .. or our versions of the js files not minimized ..
    all of us other developers with these handicaps are forced to read up on extj's publications .. or learn from those who in this forum come up with ideas they share.

    and we are forced to wait do what you write

    1 hour ago, Hayri ASLAN said:

    It is in our roadmap and we will do it.

    Ps:
    I consider UniGUI a fabulous Framework .. ...

×
×
  • Create New...