Jump to content

andyhill

uniGUI Subscriber
  • Posts

    1259
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by andyhill

  1. with (ListGrid as IUniJSInterface) do begin JSConfig('grouped', [True]); JSConfig('grouper', [JSObject(['groupFn', JSFunction('record', 'return record.get("0")')])], THUnimBasicDBGrid(ListGrid).DataStore); JSConfigObject('groupHeader', ['style', JSObject(['font-size', 16, 'color', '#000000', 'backgroundColor', '#709FD4'])]); end; Please advise why Record Field '0' does not display in Group Header ? Solved, had to add field name manually
  2. Please advise how to "Mobile DBListGrid scroll selected row into view via code" - thanks.
  3. Farshad, What worked before (unim-1.90.0.1557) with GoDaddy SSL Cert no longer works now ? 64bit compiled, 64bit dlls - claims wrong password when there was no password used ? Please advise - thanks - Andy
  4. I am now getting strange errors that do not make sense ???
  5. This is how I am doing it at present (using Form Interface), could someone please confirm if I am doing it correctly ? procedure TfLogin.UnimLoginFormCreate(Sender: TObject); begin try JSInterface.JSCallGlobal('localStorage.setItem', ['BB', 'now']); // TEST except end;
  6. Is there a way to set a LocalStorage Key without going through a component interface ? "eDatabase.JSInterface.JSCallGlobal('localStorage.setItem', ['K0', s] );" LIKE THIS ---> JSCallGlobal('localStorage.setItem', ['K0', s]);
  7. b: TUnimTitleButton; ... with TUnimTitleButton.Add do begin ButtonId:= 5; IconCls:= 'star'; Width:= 48; end; Tried code above but fails - please advise - thanks in advance
  8. Thanks Sherzod but that made no difference ? with (ListGrid as IUniJSInterface) do begin JSConfig('grouped', [True]); JSConfig('grouper', [JSObject(['groupFn', JSFunction('record', 'return record.get("0")')])], THUnimBasicDBGrid(ListGrid).DataStore); JSConfigObject('groupHeader', ['style', JSObject(['font-size', 16, 'color', '#000000', 'backgroundColor', '#709FD4'])]); end;
  9. I have code created at runtime that prior to D11 worked fine (added red params but makes no difference). with (ListGrid as IUniJSInterface) do begin JSConfig('grouped', [True]); JSConfig('grouper', [JSObject(['groupFn', JSFunction('record', 'return record.get("0")')])], THUnimBasicDBGrid(ListGrid).DataStore); JSConfigObject('groupHeader', ['style', JSObject(['size', 16, 'color', '#000000', 'backgroundColor', '#709FD4'])]); end; Please advise how to make GroupHeader Assigned Field Readable - Thanks in advance
  10. UniSession.AddJS( cbPurOwing checked = True or False )
  11. Thanks Sherzod for the Context Code. I have an issue with internal syncing of TUniCheckbox Tick with the browser - please show me how to set Checked with JavaScript instead. Here is my code:- procedure TfMain.cbPurOwingAjaxEvent(Sender: TComponent; EventName: string; Params: TUniStrings); begin ////////////////////////////////////////////////////////////////////////////// if EventName = '_RightClick_' then begin RightClickFlag:= True; ByPassChangeFlag:= True; if cbPurOwing.Checked = False then begin cbPurOwing.Checked:= True; // THIS HAS ISSUES SYNCRONIZING INTERNALLY WITH THE BROWSER ??? end else begin cbPurOwing.Checked:= False; // THIS HAS ISSUES SYNCRONIZING INTERNALLY WITH THE BROWSER ??? end; UniSession.AddJS('Ext.defer(function() {ajaxRequest(fMain.cbPurOwing, "_Process_", []);}, 1000)'); end; // '_RightClick_' ////////////////////////////////////////////////////////////////////////////// if EventName = '_Process_' then begin ByPassChangeFlag:= False; cbPurOwingChange(Self); end; end;
  12. Sherzod, the CSS above no longer works as intended ? Also I asked why I could not prevent Context Popup on Checkbox ?
  13. Sherzod, this was me testing:- CSS s:= '.customCheckboxGreen .x-form-checkbox '+ '{ '+ ' font-family: FontAwesome; '+ ' font-size: 16px; '+ ' background-image: none !important; '+ ' margin: 4px 0 0 0; '+ // Top, Right, Bottom, Left '} '+ '.customCheckboxGreen.x-form-cb-checked .x-form-checkbox:before '+ '{ '+ ' content: ''\f046''; '+ ' color: green; '+ '} '+ '.customCheckboxGreen .x-form-checkbox:before '+ '{ '+ ' content: ''\f096''; '+ '} '; CustomCSS.Add(s); // s:= '.customCheckboxRed .x-form-checkbox '+ '{ '+ ' font-family: FontAwesome; '+ ' font-size: 16px; '+ ' background-image: none !important; '+ ' margin: 4px 0 0 0; '+ // Top, Right, Bottom, Left '} '+ '.customCheckboxRed.x-form-cb-checked .x-form-checkbox:before '+ '{ '+ ' content: ''\f046''; '+ ' color: red; '+ '} '+ '.customCheckboxRed .x-form-checkbox:before '+ '{ '+ ' content: ''\f096''; '+ '} '; CustomCSS.Add(s); CHECKBOX cbPurOwing.LayoutConfig.BodyPadding:= '0 2 2 2'; // Top, Right, Bottom, Left *** NEVER UPDATES, MUST BE SET IN IDE *** with cbPurOwing.JSInterface do begin JSConfig('cls', ['customCheckboxGreen']); end; cbPurOwing.ClientEvents.ExtEvents.Clear; s:= 'mousedown=function mousedown(sender, x, y, eOpts) '#13#10 + '{ '#13#10 + // sender.preventDefault(); ' preventDefault(); '#13#10 + ' ajaxRequest(this, ''_eOpts_'', [''eOpts=''+eOpts]); '#13#10 + // eOpts=MouseButton: 0=Left, 2=Right '} '; cbPurOwing.ClientEvents.ExtEvents.Add(s); AJAXEVENT if EventName = '_eOpts_' then begin s:= Params['eOpts'].AsString; // MouseButton: 0=Left, 2=Right b:= StrToIntDef(s, 0); if b = 2 then begin // removeCls, addCls (setCls) configs with cbPurOwing do begin JSInterface.JSCall('removeCls', ['customCheckboxGreen']); JSInterface.JSCall('addCls', ['customCheckboxRed']); end; end else begin with cbPurOwing do begin JSInterface.JSCall('removeCls', ['customCheckboxRed']); JSInterface.JSCall('addCls', ['customCheckboxGreen']); end; end; end; // '_eOpts_' PROCESS LeftClick = Green RightClick THROWS UP CONTEXT MENU (I set disable above) ??? Please advise - thanks - Andy
  14. Yes, thank you Sherzod, colour is good - but how do I change this colour at runtime due to some internal status ? eg. if FaultyFlag = True then begin TickColor = Red end else begin TickColor = Green end;
  15. Perhaps I should have said not a static CSS rule, I need an individual approach that will not effect any other checkbox
  16. I have a need to use the colour of the CheckBox tick to indicate a particular status where one can change its colour at runtime (not CSS) - please advise - thanks.
  17. I need key press not key down. procedure TfMain.dbGridPurchasesKeyPress(Sender: TObject; var Key: Char); NEVER FIRES ?
  18. Sherzod, do you understand from my code above ? The Grid is not in edit mode, user scrolls Grid Rows, user presses SPACE bar on a desired Row, I capture the Key Event and test for SPACE Key - if pressed I then flip the Table Row Field TAG to True or False accordingly. Please advise
  19. dbGridPurchases.ClientEvents.ExtEvents.Clear; s:= 'keypress=function keypress(e, t, eOpts)'#13#10 + '{ '#13#10 + ' ajaxRequest(sender, '#39'_KeyPressed_'#39', ["key="+e.getKey()]); '#13#10 + '} '; dbGridPurchases.ClientEvents.ExtEvents.Add(s); ... ////////////////////////////////////////////////////////////////////////////// procedure TfMain.dbGridPurchasesAjaxEvent(Sender: TComponent; EventName: string; Params: TUniStrings); ... if EventName = '_KeyPressed_' then begin if Params.Values['key'] = ' ' then begin ReadOnly:= False; if UniMainModule.tblPurchases.ReadOnly = True then begin ReadOnly:= True; UniMainModule.tblPurchases.ReadOnly:= False; end; if UniMainModule.dsPurchases.DataSet.State in [dsInsert, dsEdit] then begin // DB // do nothing end else begin UniMainModule.tblPurchases.Edit; end; if UniMainModule.tblPurchases.FieldByName('Tag').AsBoolean = True then begin UniMainModule.tblPurchases.FieldByName('Tag').AsBoolean:= False; end else begin UniMainModule.tblPurchases.FieldByName('Tag').AsBoolean:= True; end; UniMainModule.tblPurchases.Post; if ReadOnly = True then begin UniMainModule.tblPurchases.ReadOnly:= True; end; end; end;
  20. Grid Active and not in edit mode, need to flip Tag field for focused ROW with SpaceBar via event
  21. I suppose different solutions are possible (including monitoring Form KeyPress) BUT after seeing procedure dbGridInvoicesKeyPress(Sender: TObject; var Key: Char); not work I then tried the JS way as shown above which also does not work ? I assume I have done something wrong ? I would like to do this the JS way if you would be so kind and show me how please - thanks Sherzod.
×
×
  • Create New...