delagoutte Posted August 8, 2018 Share Posted August 8, 2018 In my app, when a user connect to the app, there is many configuration for his environment. i have a code that is is like this : if userconnnect = true then begin LoadMainGridtitle; //set column title with user value LoadMaingridColumnconf; //size, position, hidden... LoadMaingridFilter;// load saved filter value and apply LoadMainGridSort; LoadRightPanelConf; // size ans collapse state if not panelRight.collapsed then LoadFrameTree;//create frame TFrmTree and Assign to panel LoadLeftPanelConf; if not letfRight.collapsed then LoadFrameForLeftPanel; ..... end; All this code generate a big js (700ko) that is send to client by unigui but during this generation the client don't see anything move in front of his eyes. i would like do a thing like this but i not sure it is the best and the simple way. What do you think ? LoadMainGridtitle; //set column title with user value --->>send to client for apply in client side LoadMaingridColumnconf; //size, position, hidden... --->>send to client for apply in client side LoadMaingridFilter;// load saved filter value and apply --->>send to client for apply in client side LoadMainGridSort; --->>send to client for apply in client side What is the best way to do this ? i think a thing like but is it a good way and is it the simple way ? if user.connectd then begin LoadMainGridtitle; //set column title with user value unisession.addjs('ajaxrequest('+mainform.jsname',"LoadCustomConf",[value=1]'); end; ...... procedure tmainform.UniFormAjaxEvent(Sender: TComponent; EventName: string; Params: TUniStrings); begin if eventname = 'LoadCustomConf' then begin if params.values['value']=1 then begin LoadMaingridColumnconf; //size, position, hidden... unisession.addjs('ajaxrequest('+mainform.jsname',"LoadCustomConf",[value=2]'); end; if params.values['value']=2 then begin LoadMaingridFilter;// load saved filter value and apply unisession.addjs('ajaxrequest('+mainform.jsname',"LoadCustomConf",[value=3]'); end; ........ end; Quote Link to comment Share on other sites More sharing options...
delagoutte Posted August 8, 2018 Author Share Posted August 8, 2018 hum , maybe it is UniSession.Synchronize; that i need ? Quote Link to comment Share on other sites More sharing options...
Wilton Ergon Posted August 9, 2018 Share Posted August 9, 2018 use SuspendLayouts and ResumeLayouts new feature include in version 1.10.0.1470 see sample SuspendLayouts Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.