Jump to content

eono

Members
  • Posts

    40
  • Joined

  • Last visited

  • Days Won

    2

Posts posted by eono

  1. On 5/29/2020 at 12:26 PM, Mehmet Emin said:

    OK, browser will cache those static files after first fetch.

    But the first fetch speed is so important to user experience so please allow ExtRoot and other properties for setting static served files to be set like this.

    ExtRoot := 'http://cdn.aaaaaaaaa.com/'

    We need to have minimum impact on the web app server. It should serve the dynamic content.

    All static resources better served by a cdn.

    Thanks

    I had asked/have requested this a long time ago. It would really be good to have.

    • Like 2
    • Upvote 1
  2. How will you change the data on the grid, all the changes at one "moment"?

    Using the code you provided, I can make the changes on the grid clientside. When I am done I can then click a button on the grids form and send all changes made to the grid to the server.

  3. Thanks for your prompt replies @delphideveloper

     

    I want a situation where it doesn't contact the server until I explicitly want it to. Say I need to process 5 columns for 4 rows, with this I will hit the server 20 times in total. What I want is to hit the server just once, when I am done and I click a button 'Save' on the grid's form.

     

    Is there no way to delay the grids synchronization until when saving or manually trigger the synchronization?

     

    Kind regards.

  4. Hi,

     

    Maybe like this ?:

    var grid = MainForm.UniDBGrid1;
    var edPlugin = grid.editingPlugin;
    
    edPlugin.startEditByPosition({
        row: 0,
        column: 1
    });
    edPlugin.getActiveEditor().field.setValue("newValue");
    edPlugin.completeEdit();
    

    Best regards,

     

    Perfect! You the men. Lost some hair trying to get this to work.  :biggrin:  :biggrin:  :biggrin:

    • Like 1
  5. Hi,

     

    How can I update the value of a particular cell of a row using Javascript on the client and still have the value submitted to the server on grid post?

     

    I have tried:

    store = frm.dbg.store
    r = getAt(0)
    r[0] = 'new value'
    r.commit() 
    // at this point, the data shows in the grid
    
    

    When I do a save of the grid using the navigators save button, the new data entered, and displayed on the grid, is not saved to the server. Doing a normal data edit on the grid saves any grid changes.

     

    What am I missing?

     

  6. Hi All,

     

    I have a form where the user is supposed to chose from a total of 18 comboboxes (cmb). Each of the cmb has the same set of data in the items list. Now the user is expected to select different options for the 18 cmbs.

     

    1. If I load all the 9 cmbs at the server during form creation, I have a feeling that the amount of memory used will be wasted as I am basically repeating the same set of data, almost 50 rows, 18 times over - giving a total of 900 rows!!! I expect this app to be in use by more than 1500 people SIMULTANEOUSLY. The Server has memory, but I like proper design if I can swing it.

     

    2. In trying to conserve memory, I re-assign the store of one cmb to all the other cmbs at the client. This works perfectly on the client side, but when I try to read the data selected in the cmb at the server, it returns a blank. Its like there is no data as far as the server is concerned.

     

    My question:

    A. Is (1) a good design? Am I worrying too much? The forms are pretty complicated with lots of other components. I don't want to have to refactor If memory is an issue during live.

    B. How come UG doesn't reflect client side manipulations of certain components on the server side? Is there a way around this?

     

    NB. I CANNOT use a grid for the design.

     

    Kind regards.

  7. Hi Farshad,

     

    1. How unique are the sessionid's? If I run the UniGUI application 1000 times, what is the guarantee that the sessionid generated will be unique?

     

    2. If the uniqueness is not guaranteed, is it possible to have my own sessionids generated and assigned? There is no function exposed for when a session is started. In the oncreate event of the mainmodule, the sessionid has already been assigned and I was getting all kinds of errors when I assigned a value there.

     

    Note: followed this and didn't find where, if any, the issue was added/fixed.

    http://forums.unigui.com/index.php?/topic/4381-log-sessionid-and-ip/?hl=sessionid

  8. Hi Ronny,

     

    This is a classic case of cachedupdates somewhere along the line.

     

    1. What database access technology are you using?

    2. Ensure you don't have cachedupdates or something similar set on the data access object.

    3. Check very very well. Somewhere something is somehow caching the updates and its being applied when the the form closes.

     

    Regards.

     

    Eldad

  9. Hi All,

     

    Got stock UniKendoDataViz for work.

     

    Versions:

    UniGUI: Version:0.93.1 build 999

    Delphi: XE2

    TUniKendoDataViz:  stock version above

     

    Edits:

    1.  Constructor:

    constructor TUniKendoDataViz.Create(HostFrame: TUniHTMLFrame);
    var
      p: TWinControl;
    begin
      HTMLFrame := HostFrame;
      DOM_ID := HTMLFrame.JSName + '_id';
      p := HTMLFrame.Parent;
      while not ((p is TUniForm) or (p is TUniFrame)) do
        p := p.Parent;
      AjaxHandler := p.Name + '.' + HTMLFrame.Name;
      HTMLFrame.OnAjaxEvent := UniHTMLFrameAjaxEvent;
      Series := TStringList.Create;
      Properties := TStringList.Create;
      SeriesProperties := TStringList.Create;
      Title := 'Kendo Chart';
      Theme := 'default';
      DefaultType := 'column';
      Clear;
    end;

     

     

    2. Render:

    function TUniKendoDataViz.Render;
    var
      chart, sl: TStringList;
      i: integer;
      sClick: string;
    begin
      chart := TStringList.Create;
      sl := TStringList.Create;
      { 04-may-2013}
      //add tooltip
      //chart.Add('tooltip: {visible: true,format: "{0:C}",template: "#= series.name #<br /> #number_format(#= value #)"}'); kendo.template(number_format(5000000))
      if sametext(DefaultType,'pie')  then
        chart.Add('tooltip: {visible: true,format: "{0:C}",template: "#= category #<br /> #= number_format(value,2,''.'','','') #"}')
      else
        chart.Add('tooltip: {visible: true,format: "{0:C}",template: "#= series.name #<br /> #= number_format(value,2,''.'','','') #"}');
      { 04-may-2013}
     
      // map Title property
      chart.Add(Format('title: {text: "%s"}', [Title]));
      // map Theme property
      chart.Add(Format('theme: "%s"', [Theme]));
      // map DefaultType, DefaultProperties and Stack property
      sl.Add(Format('type: "%s"', [DefaultType]));
      sl.Add(Format('stack: %s', [boolToStr(Stacked)]));
      if SeriesDefaults <> '' then sl.Add(SeriesDefaults);
      chart.Add(Format('seriesDefaults: {%s}', [implode(sl)]));
      sl.Clear;
      // generates data series
      for i := 0 to Series.Count - 1 do begin
        if Series.Names <> 'categoryAxis' then
          sl.Add(RenderSeries(Series.Names))
        else
          chart.Add(Format('categoryAxis: %s', [RenderSeries('categoryAxis')]));
      end;
      if sl.Count > 0 then chart.Add(Format('series: [%s]', [implode(sl)]));
      sl.Clear;
      // add other additional properties
      for i := 0 to Properties.Count - 1 do
        chart.Add(Format('%s: %s', [Properties.Names, Properties.ValueFromIndex]));
      // assign onclick callback
      chart.Add(Format('seriesClick: function(e) {ajaxRequest(%s, "Click", '+
        '["name="+e.series.name, "category="+e.category, "value="+((typeof e.value===''object'')?e.value.x+","+e.value.y:e.value)]);}',
        [AjaxHandler]));
      (*sClick := Format('ajaxRequest(%s, "Click", '+
        '["name="+e.series.name]);',
        [AjaxHandler]);
      chart.Add('seriesClick: function(e) {' + sClick + '}'); *)
      // get the final KendoChart javascript object
      Result := '{' + Implode(chart) + '}';
      FreeAndNil(sl);
      FreeAndNil(chart);
    end;

     

     

    3.  Draw:

    procedure TUniKendoDataViz.Draw;
    var
      str: string;
    begin
      (*  the 2 find('div') statements are commented out below. This is the only way to have it draw. I have not researched the reason why.  *)
      str := Format('$("#%s")./*find("div").find("div").*/kendoChart(%s);', [DOM_ID, Render]);
      UniSession.AddJS(str);
    end;
     
     
     
    @Admin: Hope posting source code updates to components as regular posts is allowd?
    @Zilav: I could send you my updates so u can incorporate into your sources.
     
    Regards
    • Upvote 2
  10. Can you give us more info on this?

     

    I would want the js files currently served and used by UG, that is all files in the ext.x.y.z folder, to be hosted on a cdn eg: cachefly. This will allow the UG application not to be serving static files. I currently use the embedded server for production applications. It has served well, but I want it to be snappier as it wastes time serving static UG files.

     

    You have no other options if you want to deploy you app in form of an ISAPI module.

     

    What I meant here is that I dont want to have to use ISAPI since this allows me to host the UG js files externally.

  11. Is it possible to host UG files in a cdn eg cachefly? This will make the UG app very lean and focus on handling core business logic and presentation, and not be saddled with hosting static files. I also do not want to have to setup IIS/Apache and use ISAPI module.

     

    Kind regards.

  12. Hi,

     

    I want to setup a method on the server of the form:

     

    /server_methods/none_ajax_method_to_call_from_javascript_html_page

     

    The 'none_ajax_method_to_call_from_javascript_html_page' method should have all the name:value pairs of the caller.

    I need this for a JS component that needs to call a specific script on the server.

     

    Kind regards

  13. If output file is an ISAPI dll then it maybe in use by ISAPI server. If not it looks like an XE2 issue. At compiling stage, a uniGUI app is just like any other Delphi app.

     

    Hi Farshad,

     

    Thanks for you reply.

     

    It is a regular uG standalone app. I have other projects in the project group that compile. Only this particular app that doesnt compile. Even though i would want to say its an XE2 thing, cos it started after I upgraded to XE2 update 2, it only happens with this application.

     

    The only solution right now is to manually delete the file and recompile the app. I have googled and all solutions found did not solve my problem.

     

    If you suspect XE2, were do you think I should post the issue? I have not posted on Inprise/Borland/Codegear/Embarcadero before. :-(

     

    Kind regards.

  14. Whenever i compile my UG app in XE2, it keeps giving F2039 : could not create output file. This only happens in this particular UG app. If i delete the file, then the compile goes through. I have searched high and low and am very very confident and sure that the file is not in use. Deleting the file does not raise any 'file in use error'

     

    Env.

    . Win 7

    . XE 2 with update 2

    . UG 87.901

     

    Am at a loss here as having to delete d file before compiling/building is very cumbersome.

     

    Any pointers/help will be appreciated.

×
×
  • Create New...