Jump to content

andyhill

uniGUI Subscriber
  • Posts

    1262
  • Joined

  • Last visited

  • Days Won

    6

Posts posted by andyhill

  1.       try
            JSInterface.JSCallGlobal('localStorage.removeItem', ['_K1_']);
            JSInterface.JSCallGlobal('localStorage.removeItem', ['_K2_']);
          except
          end;
    
          try
            Button.JSInterface.JSCallGlobal('localStorage.removeItem', ['_K1_']);
            Button.JSInterface.JSCallGlobal('localStorage.removeItem', ['_K2_']);
          except
          end;

    Can someone please advise why RemoveItem fails to remove ? Thanks in advance

  2. It is hard because the project is complex, looking on forum others are having same problems with TUnimDBListGrid.

    The Field 'Accepted' is boolean, grid shows 'true' or 'false'.

    with ListGrid do begin
          Columns.BeginUpdate;
          Columns.Clear;
          //////////////////////////////////////////////////////////////////////////
          i:= 0;
          Columns.Add;
          Columns.Items[i].FieldName:=                      'Accepted';
          Columns.Items[i].Visible:=                        True;
          Columns.Items[i].CheckBoxField.BooleanFieldOnly:= True;
          Columns.Items[i].CheckBoxField.FieldValues:=      'true,false';
          Columns.Items[i].CheckBoxField.DisplayValues:=    '+;-';
          Columns.Items[i].CheckBoxField.Enabled:=          True;
          Columns.Items[i].Alignment:=                      taCenter;
          Columns.Items[i].Title.Alignment:=                taCenter;
          Columns.Items[i].Title.Caption:=                  'OK';
          //Columns.Items[i].Flex:=                           1;
          Columns.Items[i].Width:=                          30;
          Columns.Items[i].Font.Color:=                     clBlack;
          Columns.Items[i].Sortable:=                       False;
          Columns.Items[i].ShowSummary:=                    False;
          //////////////////////////////////////////////////////////////////////////
          Columns.EndUpdate;
    end;

    Andy

  3. procedure TfMain.ListGridAfterLoad(Sender: TUniCustomDBGrid);
    var
      DBGridJSName: string;
      _RecNo: Integer;
    begin
      ListGrid.SetFocus;
      if ListGrid.DataSource.DataSet.RecordCount > 0 then begin
        ListGrid.DataSource.DataSet.First;
        DBGridJSName:= ListGrid.JSName;
        _RecNo:= 1;
        UniSession.AddJS(DBGridJSName + '.getSelectionModel().select('+ DBGridJSName +'.getStore().data.indexOfKey('+ IntToStr(_RecNo) +'), true)');
      end;
    end;

    Please advise how to do this for TUnimDBListGrid - thanks

  4. Thanks but not working, what am I missing (grid columns built at runtime) ?

          Columns.Items[i].CheckBoxField.BooleanFieldOnly:= True;
          Columns.Items[i].CheckBoxField.FieldValues:=      'true,false';
          Columns.Items[i].CheckBoxField.DisplayValues:=    '+;-';
          Columns.Items[i].CheckBoxField.Enabled:=          True;
     

  5. I need to display a column as checkbox in code, please show how - Thanks

    with MyGrid do begin

          //Columns.Items[i].CheckBoxField:=   True;
          //Columns.Items[i].CheckBoxField:=   chkConfirmedEditor;
          //Columns.Items[i].Editor:=                  chkConfirmedEditor;

  6. All of a sudden my UNIGUI Sencha Project Crashes Under Chrome (works with Edge)

    Disallow sync XHR in page dismissal - Chrome Platform Status (chromestatus.com)

    Chrome now disallows synchronous XHR during page dismissal when the page is being navigated away from or closed by the user. This involves the following events (when fired on the path of page dismissal): beforeunload, unload, pagehide, and visibilitychange. A temporary opt-out is available via Origin Trial "Allow Sync XHR In Page Dismissal": https://developers.chrome.com/origintrials/#/trials/active

    Motivation

    Synchronous XHR is on the deprecation path. It hurts the end user experience. beforeunload and unload are used by third parties and first parties to send analytics data to servers. While this is reasonable, there are no good reasons to use synchronous XHR. Instead SendBeacon, Fetch keep-alive should be used (in addition to sending analytics periodically and on pagevisibility etc.). Page dismissal is also an interesting scenario for the following reasons: 1. It hurts the user experience when the user is trying to leave the page or navigate (up to a max timeout of 1s, which is 2s in practice in chrome) 2. The intention of beforeunload handler is a mechanism for preventing data loss for users, however it is used by third parties as a way to reliably do a bunch of work (including sync xhr), up to the max timeout. Some relevant data in this slide deck. This hurts the end user experience. 3. As part of Page Lifecycle API: we want to experiment with running the beforeunload handler at the time of freezing (to determine risk of data loss) to support proactive tab discarding. And Sync XHR (and large amount of work) is problematic here. For now, enterprise users can use the AllowSyncXHRInPageDismissal policy flag and developers can opt into the AllowSyncXHRInPageDismissal origin trial to allow synchronous XHR requests during page unload. We expect to remove this flag in Chrome 93.

     

     

    No settings have been changed in Chrome - Could someone please advise how to resolve - Thanks

  7. I am trying to walk all other open sessions and queue an fForm ajaxevent (is the lock preventing it from broadcasting) - How

    MainModule
      UniServerModule.BroadCastRefresh(UniSession.SessionID);

    procedure TUniServerModule.BroadCastRefresh(SessionID: String);
    var
      i: Integer;
      S: TUniGUISessions;
      U: TUniGUISession;
    begin
    
      //////////////////////////////////////////////////////////////////////////////
      S:= SessionManager.Sessions;
      S.Lock;
      try
        for i:= 0 to S.SessionList.Count - 1 do begin
          U:= S.SessionList[i];
          if U.UniMainModule <> nil then begin
            if U.SessionId <> SessionID then begin
              U.AddJS('ajaxRequest(fMain.window, "_RefreshRequired_", []);');
            end; // <> SessionID
          end; // nil
        end; // for
      finally
        S.Unlock;
      end;
    
    end;

     Not Firing.

  8. Thanks Sherzod, my implementation below does the job as me.getStyle('font-size') is the UniGUI default and I need breathing room around the text.

      MyScript:= 'painted=function painted(sender, eOpts) '+
                 '{ '+
                 '  var me = sender.inputElement; '+
                 '  me.setStyle(''line-height'', ''1.25''); '+ 
                 '} ';
      DisplayMemo.ClientEvents.ExtEvents.Add(MyScript);
     

×
×
  • Create New...