Jump to content

andyhill

uniGUI Subscriber
  • Posts

    1257
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by andyhill

  1. Because it is mobile (touch) on desktop /m
  2. 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
  3. 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
  4. Gotit with ListGrid do begin JSInterface.JSCode('Ext.defer(function(){'#1'.select('+IntToStr(UniMainModule.ID)+')}, 150);'); end;
  5. 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
  6. Understood, but this code ran perfectly for years, now with latest updates (Windows,Chrome,UniGUI) it is crashing ?
  7. 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;
  8. Set accordingly, still crashes after TUniComboBox selections
  9. 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;
  10. 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
  11. 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.
  12. I was asking for the unit that holds this function (IdGlobal) Also the Process Function parameter breakdown
  13. ReadStringFromStream ? ProcessTheData(aJSONData); ?
  14. 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);
  15. Please advise how to set UnimMemo Line Spacing in code - thanks in advance. I tried this but has no effect ? DisplayMemo.ClientEvents.ExtEvents.Clear; MyScript:= 'afterrender=function afterrender(sender, eOpts) '+ '{ '+ ' sender.inputEl.setStyle(''line-height'', ''26px''); '+ '} '; DisplayMemo.ClientEvents.ExtEvents.Add(MyScript); //margin-bottom: 1em; //line-height: 1.25;
  16. When ever a user selects a row in a grid I want to know (via ajaxevent).
  17. ... DBListGrid.ClientEvents.ExtEvents.Clear; s:= 'select=function select(sender, selected, eOpts)'#13#10+ '{'#13#10+ ' ajaxRequest(fMain.DBListGrid, ''_SelectedRow_'', ["row="+selected.???]);'#13#10+ '}'; DBListGrid.ClientEvents.ExtEvents.Add(s); ... procedure TfMain.DBListGridAjaxEvent(Sender: TComponent; EventName: string; Params: TUniStrings); begin ////////////////////////////////////////////////////////////////////////////// if SameText(EventName, '_SelectedRow_') then begin SelectedRowNumber:= Params.Values['row'].ToInteger; end; ...
×
×
  • Create New...