Leaderboard
Popular Content
Showing content with the highest reputation since 01/19/25 in all areas
-
Hello, The same logic on ExtEvents : 'reconfigure=function (sender, store, columns) '+ '{ columns[1].renderer=function(value, .... As Reconfigure function does not exists for UnimDBListGrid, you can use OnGetText Tip. All is on the HTML Css suggested by Hayri. 1. Put the CSS on ServerModule 2. Set OnGetText : procedure TMainmForm.ClientDataSet1F1GetText(Sender: TField; var Text: string; DisplayText: Boolean); begin Text:='<div class="record-card"> '+ ' <div class="record-header"> '+ ' <strong>Record [' + intToStr(ClientDataSet1.RecNo) + ' of ''' + intToStr(ClientDataSet1.RecordCount) + ''']</strong> '+ ' </div> '+ ' <div class="record-content"> '+ ' <img src="https://loremflickr.com/60/60?random=1" class="profile-img"> '+ ' <div class="info"> '+ ' <p><strong>Company:</strong> ' + ClientDataSet1.FieldByName('F3').AsString + '</p> '+ ' <p><strong>Model: </strong> ' + ClientDataSet1.FieldByName('F2').AsString + '</p> '+ ' </div> '+ ' </div> '+ ' <div class="contact-info"> '+ ' <h3>Contact Info</h3> '+ ' <p><strong>Address:</strong> My Adresse </p> '+ ' <p><strong>City:</strong> MyCity </p> '+ ' </div> '+ ' </div>'''; end; Elegant_Mobile_CardView.7z5 points
-
I've been working with the GridColumnSort demo. I've modified it by adding a new column at the beginning of the grid. procedure TMainForm.UniFormCreate(Sender: TObject); begin UniDBGrid1.ClientEvents.ExtEvents.Add( 'reconfigure=function (sender, store, columns) '+ '{ columns[0].renderer=function(value, metaData, record) {data=record.data; '+ ' return ''<div class="record-card"> '+ ' <div class="record-header"> '+ ' <strong>Record [''+(record.id+1)+'' of ''+record.store.totalCount+'']</strong> '+ ' </div> '+ ' <div class="record-content"> '+ ' <img src="https://loremflickr.com/60/60?random=1" alt="''+data[''2'']+''" class="profile-img"> '+ ' <div class="info"> '+ ' <p><strong>Company:</strong> ''+data[''2'']+''</p> '+ ' <p><strong>Contact:</strong> ''+data[''12'']+''</p> '+ ' <p><strong>Cust No:</strong> ''+data[''1'']+''</p> '+ ' </div> '+ ' </div> '+ ' <div class="contact-info"> '+ ' <h3>Contact Info</h3> '+ ' <p><strong>Address:</strong> ''+data[''3'']+'' ''+data[''4'']+''</p> '+ ' <p><strong>City:</strong> ''+data[''5'']+''</p> '+ ' <p><strong>Postal Code:</strong> ''+data[''7'']+'' <strong>State:</strong> ''+data[''6'']+''</p> '+ ' <p><strong>Country:</strong> ''+data[''8'']+''</p> '+ ' <p><strong>Home Phone:</strong> ''+data[''9'']+''</p> '+ ' </div> '+ ' </div>'';}; '+ ' }'); end; ServerModule -> CustomCSS .record-card { width: 400px; background: white; padding: 15px; border-radius: 8px; box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); margin: 20px auto; } .record-header { font-size: 16px; font-weight: bold; padding-bottom: 10px; border-bottom: 1px solid #ccc; } .record-content { display: flex; align-items: flex-start; margin-top: 10px; } .profile-img { width: 60px; height: 60px; border-radius: 50%; margin-right: 10px; } .info p { margin: 3px 0; } .contact-info { margin-top: 10px; padding: 10px; border: 1px solid #ddd; border-radius: 5px; background: #fafafa; } .contact-info h3 { margin-top: 0; font-size: 14px; } .contact-info p { margin: 3px 0; font-size: 12px; }4 points
-
Irigsoft, IMO the uniThreatTimer is the wrong tool for the issue you are having and I would like to suggest a different approach. My suggestion makes the following assumptions based on our description of the issue you are having: The browser is waiting for a response from the server but this is not forthcoming because some code is in an endless loop. Because of above, user actions like mouse-clicks and key-presses are not reaching the server Assuming the above assumptions are correct it seems what you need to do is to recognise the fact that the server has lost contact with the user and force a session termination. To this end I have attached a simple project that works as follows: The ServerModule has a very low session-timeout (2 seconds) Whenever the Session-timeout event fires the timeout value is reapplied to keep the server alive, provided we continue to detect user activity, otherwise the session is allowed to die. As long as there is user activity the main form is pinged every 5 seconds and this fact is used to keep the server alive. The main form uses a timer to measure user idleness and this is used to warn the user of impending termination or, if there is still no reaction within the required period, to signal a session termination. Obviously this solution will only work if the uniTimer continues to fire, which I think is the case, regardless of whatever the endless loop is. I hope this is of some use and that you can adept the idea to at least solve the resource issue you are having. The project uses the following timing values which you can modify Main form ping intervals : 5 seconds Idle seconds before warning the user : 2 minutes Idle seconds before session termination : 4 minutes TimeOutDemo.zip2 points
-
Hello @lema Hoping you feal good. Also try this from our Maestro Sherzod. https://forums.unigui.com/index.php?/topic/14898-config-period-time-default-calendarpanel/#findComment-811302 points
-
Hello, If your session is hung for any reason there is no way to terminate it. A session hangs mostly because of a bug or a runtime error. In some cases it happens because it goes into a dead-lock or an infinite loop. This means that a method or an event never finishes and stays in running state forever. uniGUI can't recover from such situations. The only way is to avoid these situations from happening in the first place.2 points
-
1 point
-
1 point
-
Hi Experts, I have a MainmForm with a UnimDBListGrid. After updating DataSet On Disclose, it is obvious to go to the current DataSet freshly updated. GotoBookmark does its job, but as the mainForm is scrollable, i can't go to the current VertScrollBar.ScrollPos (position). So, how to get and set a MainmForm.VertScrollBar (with JavaScript) ? Thx. Edited : Forget this topic ! I realized that I wasn't using the right design. The good practice is : 1. OnDisclose > ShomModal Form to Edit Record, then after MrOK 2. procedure TfrmClient.ShowCallBack(Sender: TComponent; Res: Integer); begin if res=1 then begin myDataSet.RefreshRecord; UnimDBListGrid1.RefreshCurrentRow(False); // False = not full reload Data end; end; With this : UnimDBListGrid1 refresh the Current record and preserves its position, even with a large VertScrollBar Position.1 point
-
Yes, this is one of the solutions, it's up to you. But for dynamically created buttons you can also use the following method: UniButton1.JSInterface.JSAddListener('afterrender', 'function(){this.setWidth(null)}');1 point
-
1 point
-
1 point
-
procedure TUniFormCadAtendimentoAvulsoCheckListResposta.AjustarLarguraBotao(Botao: TUniSpeedButton); var Bmp: TBitmap; TextWidth: Integer; begin Bmp := TUniBitmap.Create; try Bmp.Canvas.Font.Size := Botao.Font.Size; Bmp.Canvas.Font.Name := Botao.Font.Name; TextWidth := Bmp.Canvas.TextWidth(Botao.Caption); Botao.Width := TextWidth + 44; finally Bmp.Free; end; end; I used this function generated by chatGpt, it doesn't seem like the best of both worlds, but it worked fine in the tests I did.1 point
-
I'm replying to myself... The only thing I could find is the following. It seems to meet my needs. .x-calendar-event { pointer-events: none !important; }1 point
-
I am trying to use a DBMemo component inside a FieldSet. I had done a sample project to show the strange behavior. This is the screen with the problem. The first component is a DBMemo, and the second one is a DBMemo inside a FieldSet. The DBMemo inside FieldSet shows only one line. Why? There is no difference when alignment is equal to none or to client. I have attached the project to this post. I would like to know what I am doing wrong. Could you, please, help me to solve this problem? Thanks ProjetoTeste.zip1 point
-
1 point
-
Hi, For iOS, just setting the Favicon property won’t work because iOS requires a special apple-touch-icon. Put your icon in the "files" folder of your UniGUI app and name it apple-touch-icon.png. Add the file to ServerModule.CustomFiles so UniGUI serves it: files/apple-touch-icon.png Add this line in ServerModule.CustomMeta: <link rel="apple-touch-icon" sizes="180x180" href="files/apple-touch-icon.png"> Make sure your app runs over HTTPS, or iOS won’t allow adding it to the home screen properly. After doing this, open your app in Safari on an iPhone, tap Share → Add to Home Screen, and your icon should show up.1 point
-
procedure TUniFormPadraoValidarNegociar.UniFormAfterShow(Sender: TObject); begin with UniDBGridNegociacoes.JSInterface do JSCallDefer('getPlugin(''rowWidget'').toggleRow', [0, JSStatement(JSName+'.getStore().data.items[0]')],200); end; Work!1 point
-
I managed to use the UniSyntaxEdit1 component: Here's the answer: procedure TUniNF_VerXML.UniFSButton3Click(Sender: TObject);var vXMLDoc: TXMLDocument; begin vXMLDoc := TXMLDocument.Create(self); try vXMLDoc.Active := False; vXMLDoc.XML.Clear; vXMLDoc.XML.Text:= FormatXMLData(UniMainModule.IBQNFESaidaxml.AsString); //XML gravado no banco de dados vXMLDoc.Active := True; UniSyntaxEdit1.Text:=vXMLDoc.XML.Text; finally vXMLDoc.Free; end; end; RESULT:1 point
-
Thanks @Sherzod, I solved adding this function to ClientEvents.ExtEvents.painted event, from the post you mentioned. function painted(sender, eOpts) { var me=sender.inputElement; if (me) { me.dom.setAttribute('step', '0.5'); } }1 point
-
1 point
-
Ok, thank you. Works as expected: JSCall('tabPanel.tabBar.add', [UniToolBar3.JSControl]); //added on the left side JSCall('tabPanel.tabBar.add', [JSObject('xtype: "tbfill"')]); JSCall('tabPanel.tabBar.add', [UniLabel1.JSControl]); //addeded on the right side JSCall('tabPanel.tabBar.add', [UniToolBar2.JSControl]); //addeded on the right side1 point
-
Hello, you can try with the following dpk (save it as UniGMapAthens.dpk) package UniGMapAthens; {$R *.res} {$ALIGN 8} {$ASSERTIONS ON} {$BOOLEVAL OFF} {$DEBUGINFO ON} {$EXTENDEDSYNTAX ON} {$IMPORTEDDATA ON} {$IOCHECKS ON} {$LOCALSYMBOLS ON} {$LONGSTRINGS ON} {$OPENSTRINGS ON} {$OPTIMIZATION ON} {$OVERFLOWCHECKS OFF} {$RANGECHECKS OFF} {$REFERENCEINFO ON} {$SAFEDIVIDE OFF} {$STACKFRAMES OFF} {$TYPEDADDRESS OFF} {$VARSTRINGCHECKS ON} {$WRITEABLECONST OFF} {$MINENUMSIZE 1} {$IMAGEBASE $400000} {$IMPLICITBUILD ON} requires rtl, vcl, vclimg, dbrtl, vcldb, uniGUI29, uIndy29, uniTools29; contains UniGMap in 'UniGMap.pas'; end.1 point
-
Hello, One possible solution: procedure TMainmForm.UnimFormCreate(Sender: TObject); begin UnimDBNavigator1.JSInterface.JSAddListener('added', 'function(me){me.getDockedItems().forEach(function(btn){btn.setStyle({flex: "100%"})})}'); end;1 point
-
1 point
-
Hello, I would say that your approach is incorrect, considering the fact that we have added formatting logic. Firstly, this assignment code is redundant, and secondly, it can lead to undesired behavior, as in your case: ... // You can use the value as you wish. Here we are using a float value. UnimEdit1.text := NumericValue.ToString; ...1 point
-
Unfortunately I only know English so for me to look into UGFrame it would have to be demonstrated in English (fully translated).1 point
-
I created your explanation as a Sample. ThosandSeperatorInUnimEdit.rar Special thanks to @Sherzod.1 point
-
1 point
-
1 point
-
We actually created two separate solutions in this post, which might be suitable in certain cases. 🙂1 point
-
Try this approach: 1. Let's cancel the previous decision. 2. I found an interesting library, not only for your case. https://nosir.github.io/cleave.js/ Download and include it in the project: https://raw.githubusercontent.com/nosir/cleave.js/refs/heads/master/dist/cleave.min.js UniServerModule.CustomFiles -> 3. We will use UnimEdit. 4. UnimEdit1.InputType = 'text' 5. UnimEdit1.ClientEvents.ExtEvents -> function painted(sender, eOpts) { sender.cleave = new Cleave(sender.inputElement.dom, { numeral: true, numeralThousandsGroupStyle: 'thousand' }); sender.inputElement.dom.setAttribute("inputmode", "numeric"); } 6. UnimEdit1.ClientEvents.ExtEvents -> function change(sender, newValue, oldValue, eOpts) { if (sender.cleave) { ajaxRequest(sender, "numericValue", {val: sender.cleave.getRawValue()}) } } 7. UnimEdit1.OnAjaxEvent -> procedure TMainmForm.UnimEdit1AjaxEvent(Sender: TComponent; EventName: string; Params: TUniStrings); var NumericValue: Double; FormatSettings: TFormatSettings; begin if EventName = 'numericValue' then begin FormatSettings := TFormatSettings.Create; FormatSettings.DecimalSeparator := '.'; if TryStrToFloat(Params.Values['val'], NumericValue, FormatSettings) then begin NumericValue := RoundTo(NumericValue, -2); //You can use the value as you wish. Here we are using a float value. UnimNumberEdit1.Value := NumericValue; end else //ShowMessage('Invalid numeric value: ' + Params.Values['val']); end; end; 8. Uses... SysUtils, Math;1 point
-
1 point
-
Muhammad, speaking from my experience, when a project no longer runs after an update it usually has to do with timing because different core code may run longer or shorter. Producing that code dump above would require a super human to detangle. If the very same code ran before, can I suggest via debugging you locate the section just before it crashes, then re-code certain sections using DELAYS:- UniSession.AddJS('Ext.defer(function() {ajaxRequest(MainForm.window, "_MyDelayedAction_", []);}, 1000)'); This may help, of course it is best if you use the components ajaxrequest but where able you can also use the MainForm ajaxrequest and timing values from 100 to 3000 has worked for me (subject to complexity and PC speed). Farshad, Sherzod and others do an amazing job with their support but we have to play our part. I hope you did not mind me making this comment. Moderators please correct any miss-guidance I may have given above.1 point
-
1 point
-
Hi folks... Back publishing a lot of examples in next days. First this old one that I saw log time ago at the forum with fragmented solutions to uniHTMLMemo. So, you can add custom button, upload image and have a field to do search in the doc. Some solutions from uniGUi Staff and other users. I put together all in one project. Let me know if you think I should implement more stuff ... So if you need more button, upload image and do search, here we go ! This project is free to download for uniGUI subscribers. In few days will be unavailable and incorporate at our packs. uniHtmlMemoCustomButtons.mp4 Available in pack 041 point
-
1 point
-
1 point
-
Try this approach: 1. Use UnimNumberEdit 2. UnimNumberEdit.ClientEvents.ExtEvents -> function painted(sender, eOpts) { var field = sender; if (field._customSetupDone) return; field._customSetupDone = true; function customNumberFormat(value) { if (value === null || value === undefined || value === '') { return '0.00'; } const number = parseFloat(value); if (isNaN(number)) { return '0.00'; } return number.toLocaleString('en-US', { minimumFractionDigits: 2, maximumFractionDigits: 2 }); } var parent = field.up(); if (!parent) { console.error('Parent container not found!'); return; } field.formattedField = Ext.create('Ext.field.Text', { x: field.getLeft(), y: field.getTop(), width: field.getWidth(), style: 'margin: 0', value: customNumberFormat(field.getValue() || 0), clearable: true, hidden: false, listeners: { focus: function () { const rawValue = this.getValue().replace(/,/g, ''); field.setValue(rawValue); this.hide(); field.show(); field.focus(); }, clearicontap: function () { const defaultValue = 0; this.setValue(customNumberFormat(defaultValue)); field.setValue(defaultValue); this.hide(); field.show(); field.focus(); } } }); parent.add(field.formattedField); field.hide(); field.on('blur', function () { const value = field.getValue(); if (value !== null && value !== undefined && value !== '') { const formattedValue = customNumberFormat(value); field.formattedField.setValue(formattedValue); } else { field.formattedField.setValue(customNumberFormat(0)); field.setValue(0); } field.formattedField.show(); field.hide(); }); parent.on('resize', function () { field.formattedField.setLeft(field.getLeft()); field.formattedField.setTop(field.getTop()); field.formattedField.setWidth(field.getWidth()); }); }1 point
-
1 point
-
I think I've solved the problem, tomorrow I'll try to share it with you if I can fully implement it.1 point
-
procedure TMainForm.UniSpinEdit1Change(Sender: TObject); begin UniPanel1.JSInterface.JSCode(#1'.setStyle({"transform": "rotate(' + IntToStr(UniSpinEdit1.Value) + 'deg)", ' + '"transform-origin": "center", "margin": "50px auto"});' ); end;1 point
-
Thanks. Yes, the problem was that you used BorderStyle = ubsSolid. Try this approach: procedure TMainForm.UniFormCreate(Sender: TObject); begin //UniPanel1.JSInterface.JSConfig('style', ['transform: rotate(25deg); transform-origin: center; margin: 50px auto']); UniPanel1.JSInterface.JSAddListener('afterrender', 'function(me){me.setStyle({"transform": "rotate(25deg)", "transform-origin": "center", "margin": "50px auto"})}'); end;1 point
-
New Component Disponible 🎉🎉! https://store.falconsistemas.com.br 🚀 Introducing UniFSGoogleSign! We’re excited to present the newest component for the uniGUI framework, designed to integrate Google OAuth 2.0 authentication quickly, efficiently, and seamlessly. ✅ Why choose UniFSGoogleSign (Google Sign-In)? Cutting-edge technology: Supports the latest OAuth 2.0 standards. No redirects: The entire process happens seamlessly, avoiding unnecessary page reloads or redirects. Simple integration: Easy configuration with Client IDs, ready to use in your uniGUI projects. Built with AI innovation: This component was designed and developed with the help of artificial intelligence, ensuring maximum efficiency and quality. Smooth user experience: Fully functional login and logout for a frictionless experience. 💻 Perfect for developers who demand more: Achieve efficiency, modernity, and security in your systems with this thoughtfully crafted component. Sample: https://demos.falconsistemas.com.br/?tela=TfrmGoogleSign1 point
-
All functional. Just missing the project source-code. Download demo https://mega.nz/file/dVQ0FZBb#pr4P_4JmQUaATCTuPaGdPB6DxHoN4V_Pxgmof52YrOs1 point
-
no need to use google font , use any font in server , add this code in uniservermodule>css first line copy the font to the files folder : files/JF-Flat-Regular.ttf @font-face { font-family: 'mof'; src: url(files/JF-Flat-Regular.ttf); } then use the font-family 'mof' in any uni control unilable> font> name = mof , uniedit>font>name= mof ........1 point
-
Hi all, I'm testing a mix of Unigui (ExtJs Layout) and Pure.css for get a TOTAL CLIENT Responsive features. Work is in progress, but this is a short video of result. I want to get a client (in browser) responsive operations ,to avoid too much communication with the server, especially with large installations. Any hint or help is valuable, thank you! Happy New Year to all! Demo Responsive_GoogleChrome.mp41 point
-
@ThiagoFiorilli @picyka Can you please test this approach? 1. UniCheckComboBox1.ClientEvents.ExtEvents -> function afterrender(sender, eOpts) { var me = sender; var _insertCheckbox = function() { var _id = me.getPicker().id; Ext.DomHelper.insertFirst(_id, { tag: 'label', for: _id + '_allCh', html: 'AllCheck/AllUnCheck<hr>' }); Ext.DomHelper.insertFirst(_id, { tag: 'input', type: 'checkbox', id: _id + '_allCh' }); Ext.get(_id + '_allCh').on('change', function(e, combo) { ajaxRequest(me, 'allCheckUnCheck', { checked: combo.checked.toString() }); }); me.on('change', function(combo, b) { if (combo.getStore().count() == b.length) { Ext.get(_id + '_allCh').dom.checked = true } else { Ext.get(_id + '_allCh').dom.checked = false } }, { delegate: '.x-boundlist-item' }); me.getPicker().un('show', _insertCheckbox); }; me.getPicker().on('show', _insertCheckbox); } 2. UniCheckComboBox1.OnAjaxEvent -> procedure TMainForm.UniCheckComboBox1AjaxEvent(Sender: TComponent; EventName: string; Params: TUniStrings); var I: Integer; begin if EventName = 'allCheckUnCheck' then begin if Params.Values['checked'] = 'true' then begin for I := 0 to (Sender as TUniCheckComboBox).Items.Count-1 do (Sender as TUniCheckComboBox).Selected[I] := True; (Sender as TUniCheckComboBox).JSInterface.JSCall('fireEvent', ['select', (Sender as TUniCheckComboBox).JSControl]); end else begin (Sender as TUniCheckComboBox).ClearSelection; end; end; end;1 point
-
Performances are important and we use rest services for scalable system when users are a lot. Especially in a multi-server frontend system throught Hyperserver we have "remote" DB services with rest for optimize data requests and avoid big datasets in memory's UNIGUI frontend. Dataset is the most direct way in Delphi, but not the fastest way on data remoting.1 point