Leaderboard
Popular Content
Showing content with the highest reputation since 09/15/24 in all areas
-
3 points
-
2 points
-
Well, if I understand you correctly, it sounds like the issue you're encountering is due to the fact that in the onready event, not all of the UI components have been fully rendered or initialized, which can lead to Ajax issues, especially when trying to interact with components like UniDBGrid. When you use the aftershow event on a form, the rendering is typically more complete, which explains why it works better in that case. Use afterrender, afterlayout, boxready events. If you are interacting specifically with a UniDBgrid, you might want to ensure that the grid is fully rendered before making the request. You can hook into events specific to the grid, such as store.load or viewready events.2 points
-
Hi, The .tar.gz is useful for setting up the uniGUI runtime+ themes in a Linux environment or when you need to manually install the runtime without using .exe installers (but you can also use in Windows too).2 points
-
A simple procedure to draw chart 1- Create a runtime UniForm (+ A UniPanel or any parent ) as ChParent 2- Do a query, Put data in a for example Virtual table 3- Call this function procedure TMainform.DrawMyChart(TTl,Sub,XATTl : WideString; // Main title , Sub Title , X Title InTable : TVirtualTable; // I Put data in devart VirtualTable And passed to Chart... you can change it InChartType :TChartType; // Below comment InTheme :TTheme; // Below comment ChParent : TWinControl // Where you want to show chart ); // TChartType = (ctArea, ctAreaRange, ctAreaSpline, ctBar, ctBoxPlot, ctBuble, // ctColumn, ctColumnRange, ctErroBar, ctFunnel, ctGauge, ctLine, // ctPie, ctScatter, ctSpline, ctWaterFall, ctSeries, ctStreamgraph); // TTheme = (tDefault, tDarkBlue, tDarkGreen, tDarkUnica, tGray, tGrid, // tGridLight, tSandSignika, tSkies, tCustom); var Serie: TSerie; I : Integer; TestChart : TUniSFChart; begin if Not InTable.Active then InTable.Open; if InTable.RecordCount=0 then Exit; TestChart:=TUniSFChart.Create(ChParent); With TestChart Do Begin Parent:=ChParent; Name:='TestChart'; Align:=alClient; Theme := InTheme; credits.enabled := False; // ---------- you can change chart env or ignore this section // credits.href := 'https://M88.ir'; // credits.text := 'Modiran'; lang.contextButtonTitle := 'منوی گرافیکی'; lang.downloadJPEG:='JPG'; lang.downloadPDF:='PDF'; lang.downloadPNG:='PNG'; lang.downloadSVG:='SVG'; lang.downloadSVG:='SVG'; lang.loading:='بارگذاری..'; lang.printChart := 'چاپ'; lang.resetZoom := 'بزرگنمایی>برگشت'; lang.resetZoomTitle := 'بزرگنمایی 1:1'; lang.decimalPoint := '.'; lang.thousandsSep := ','; // ---------- you can change chart env or ignore until here End; with TestChart do begin DataSet:=InTable; title := TTl; SubTitle := Sub; legend.layout := lVertical; legend.align := aRight; legend.verticalAlign := vaMiddle; legend.borderWidth := 0; with xAxis.add do begin FieldName := InTable.Fields[0].FieldName; // First Column xAxisType := atCategory; end; with yAxis.add do begin title := XATTl; end; for I := 1 to InTable.FieldCount-1 do Begin Serie := Series.add; Serie.ChartType := InChartType; Serie.FieldName := InTable.Fields[I].FieldName; Serie.tooltip.valueDecimals := 1; Serie.tooltip.shared := false; End; Draw; // Draw it end; end;2 points
-
Hi, use XTemplate or HTML on query result: Here is example on MS Sql script: SELECT ('<h3 align="center" font-size=20px>'+ 'VIP Divers Club'+ '</h3>' '<h4>' + 'Christiansted' + '</br>' -- <-add new line if ||| exist on data + 'St. Croix' + '</br>' -- <-add new line if ||| exist on data + '</h4>' + '<ul><ul><h4 align="right">Price: ' + CAST (ROUND (Price,2) as varchar (20)) + ', ' + UPPER ("EUR") + '</h4></ul></ul>' ) as ProduktName2 points
-
1 point
-
1 point
-
1 point
-
@Sherzod, what do you think about having an event in the frame in the next version that only fires after everything is rendered like it is in UniForm?1 point
-
1 point
-
Date: 07/10/2024 16:19:02 User: xxxxx - Desktop Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36 Edg/129.0.0.0 Versão: 3.0.0.766 IP: 000.000.000.000 URL: Navegador: chrome Navegador Versão: 129 OS: windows SessionID: 1_uiCXQQG5Aj10FA23A0E Component: Grid_ConsAtendVeiculo (TUniDBGrid) Parent: UniFrameConsAtendVeiculo0 LastAjaxEvent: celldblclick Class: Exception Message: Config Option: O24C03->fields:[]<br/>is refering a previous request,<br/>it's not allowed in AJAX request or JS handler.<br/>Use equivalent Public Property or Method instead. ------------------------------------1 point
-
@Farshad Mohajeri, Since it is a seemingly random error, perhaps more information could be added to the capture and error message that would make it possible to identify the origin/cause of the problem?! Yesterday I faced this problem and found out it was due to the use of: Self.Showmask('Opening option...'); UniSession.Synchronize; CreateNewFrameAndAddOnNewTab('FrameName', ....); FrameName inherits from a FrameBase, that is, it is a heavy frame with many components and Queries, after removing UniSession.Synchronize() or adding the timeout to it UniSession.Synchronize(250) the problem stopped.1 point
-
Hi, I catch what user write on tuniEdit Field via keydown. If this can help try it. You must to know: 1. work on Desktop Devises all browsers - no problem 2. work on mobile Devices all browsers - no problems function keydown(sender, e, eOpts) { function pad(num, size){ return ('0000000000' + num).substr(-size); }; var getKeyCode = function (str,i) { switch (i) { case 0 : return str.charCodeAt(str.length - 1); case 1 : return str.charAt(str.length - 1); }; }; var val = sender.getValue(); var allowed = '!@#$%^&*_=.,/-[]{}|№"' + '0123456789' + 'zxcvbnmasdfghjklqwertyuiop' + 'ZXCVBNMASDFGHJKLQWERTYUIOP' ; if (event.key != "Unidentified") { var c = event.key.charCodeAt();//event.code;//event.code;//e.keyCode || e.which;//e.getCharCode();//e.keyCode; var k = event.key; } else { var c = val.charCodeAt(val.length-1);//getKeyCode(val,0); var k = val.charAt(val.length-1);//getKeyCode(val,1); } if (allowed.indexOf(k) > -1 ) { //sender.setValue(NEWValue); //Cancel the event //event.stopEvent() ; event.preventDefault(); //event.stopPropagation(); //event.stopImmediatePropagation (); }; }1 point
-
1 point
-
1 point
-
There are two types of cache in uniGUI. Global cache and session local cache. Session local cache is erased automatically when session is terminated. Global cache is not deleted, so it can be reused when application restarts.1 point
-
1 point
-
The problem is that you are overwriting your CSS import with the ServiceWorker code. To Fix: In procedure TUniServerModule.UniGUIServerModuleCreate replace the statement CustomCSS.Text = sData with CustomCSS.Text = CustomCSS.Text + sData Thaty will fix it.1 point
-
Hello @jrp We will analyze it, try this solution for now. procedure TMainForm.UniButton1Click(Sender: TObject); begin //if UniDateTimePicker1.IsBlank then if UniDateTimePicker1.DateTime = 0 then ShowMessage('Blank') else ShowMessage('Not blank'); end;1 point
-
@morphine Added support for Delphi 12 Athens1 point
-
1 point
-
1 point
-
Well, Hypergrid logic is to send the server all updates after grid editing is completed. That said, we will introduce another mode where grid will be updated each time a cell is edited. It will be available in next build.1 point
-
Unfortunately I can't say, I've never been able to simulate this, but it's something that happens every day1 point
-
Thank you very much for your good support1 point
-
I will try to understand your test case first and try to check it later today.1 point
-
Mobile Advantages There is the UnimDBListGrid component that allows you to display the data of a row in several rows using color and fonts for each record1 point
-
Thank you. This is exactly what I wanted. I made the sample. FormInBottSample.rar1 point
-
With "showAnimation": procedure TUnimForm1.UnimFormCreate(Sender: TObject); begin FullScreen := False; LayoutConfig.Width := '100%'; LayoutConfig.Height := '50%'; JSInterface.JSConfig('bottom', [0]); JSInterface.JSAddListener('painted', 'function(){this.uform.setWidth("100%")}'); JSInterface.JSConfig('showAnimation', [JSInterface.JSObject(['type', 'slide', 'direction', 'up', 'duration', 500])]); end;1 point
-
1. CustomCSS -> .edge-picker-rtl .x-dataview-item { direction: rtl; } 2. procedure TMainmForm.UniFormCreate(Sender: TObject); begin UnimDBLookupComboBox1.JSInterface.JSConfigObject('edgePicker', 'doneButton', ['Done!']); UnimDBLookupComboBox1.JSInterface.JSConfigObject('edgePicker', 'cancelButton', ['Cancel!']); UnimDBLookupComboBox1.JSInterface.JSConfigObject('edgePicker', 'cls', ['edge-picker-rtl']); //<------- end;1 point
-
Hello, this is the exact problem of everything we are talking about.1 point
-
1 point
-
One possible solution is using CSS, I will try to check.1 point
-
Mas você sabe como é o Brasil. Aqui em São Paulo tenho minha identidade no celular emitido pela secretaria de Segurança do estado. Não foi uma nem duas vezes que já encontrei funcionário zé-ruela que nem sabe que existe isto e que é valido. Bancos, nunca tive problemad, mas na TIM já bati boca explicando que é um DOC válido. Imagine um PDF assinato digitalmente lá no interior do estado na fronteira com mina-gerais. Se o peão não vé o papel com um carimbo bonito de um cartõrio, não vai aceitar nunca. É uma coisa cultural do Brasil, não acreditar no brasileiro. Ao menos agora se transfere carro aqui direto pelo site do governo. Mas com prefeituras, judiciario e todas as esferas do gover, tudo é pelo PDF assinado ao menos que queira pagar 20 reais em cada ssinatura em papel e não sei quantas vias. Rapidamente um simples papel sai por uns 100 reais so pela assinatura em cartórios. Dai o uso direto de assinatura pelo GOV.BR, ecpf e ecnpj. Economiza e muito para a empresa ou você mesmo. Mas acho que vou ter que fazer um manual sobre o assunto pois até aqui vi num post alguém anunciando uma forma de usar certificado autoassinado "sem interné" como se uma coisa dependesse da outra. Alem de formatos, emissores, tipos de encriptação, containers, ambientes e usos tem muitos outros detalhes pois cada um parece querer meter a colher e puxar o formato para seu lado. Mas quanto ao PDF, fique seguro que estou trabalhando com isso há uns 5 anos. Nest eprojeto tem todas as libs e exemplos do que precisa.1 point
-
1 point
-
Hello, This resolves various types of errors related to the sequence of requests sent to the server.1 point
-
1 point
-
Try this approach: 1. MainForm.Script -> customizeUploadForm = function() { var _winUpload = Ext.WindowManager.getActive(); _winUpload.query('textarea')[0].hide(); _winUpload.query('button')[0].setStyle({ top: '85%' }); // cancel _winUpload.query('button')[1].setStyle({ top: '85%' }); // upload _winUpload.query('button')[1].setDisabled(true); _winUpload.query('button')[1].el.dom.addEventListener('click', function(e) { //e.stopPropagation(); if (_winUpload.query('button')[1].disabled) { return false } var checkboxes = _winUpload.query('checkboxfield'); var anyChecked = checkboxes.some(function(checkbox) { return checkbox.checked; }); if (!anyChecked) { Ext.Msg.alert('Error', 'Please select at least one file.'); e.preventDefault(); } else { var dataTransfer = new DataTransfer(); var fileList = _winUpload.query('filefield')[0].getFiles(); var filesArray = Array.from(fileList); filesArray.forEach(function(file) { checkboxes.forEach(function(checkbox) { if (checkbox.checked && checkbox.inputValue === file.name) { dataTransfer.items.add(file); } }); }); _winUpload.query('filefield')[0].fileInputEl.dom.files = dataTransfer.files; } }); _winUpload.setHeight(300); _winUpload.center(); _winUpload.query('filefield')[0].on('change', function() { _winUpload.query('button')[1].setDisabled(true); var filesList = this.getFiles(); var files = Array.from(filesList); var form = _winUpload.query('form')[0]; var existingCheckboxGroup = form.down('container'); if (existingCheckboxGroup) { form.remove(existingCheckboxGroup, true); } if (files && Array.isArray(files)) { var checkboxGroup = { xtype: 'checkboxgroup', fieldLabel: 'Select files', labelAlign: 'top', padding: 10, columns: 1, width: form.getWidth() - 100, items: files.map(function(file, index) { return { xtype: 'checkbox', boxLabel: file.name, name: 'file_' + index, inputValue: file.name, listeners: { change: function(checkbox, newValue) { var checkboxes = checkbox.up('checkboxgroup').items.items; var anyChecked = checkboxes.some(function(box) { return box.checked; }); _winUpload.query('button')[1].setDisabled(!anyChecked); } } }; }) }; var container = { xtype: 'container', height: 180, margin: { top: 30, right: 0, bottom: 0, left: 0 }, style: { overflowY: 'auto' }, items: [checkboxGroup] }; form.insert(1, container); } else { console.error('Files is not an array or is undefined', files); } }) }; 2. Usage -> procedure TMainForm.btnAddClick(Sender: TObject); begin UniFileUpload1.Execute; JSInterface.JSCallGlobalDefer('customizeUploadForm', [], 10); //<-------- end;1 point
-
1 point
-
uniGUI - Favicon "Madness" FavIconMadness.mp4 Features Almost all you can do with favicon in "all-in-one" example project. All Javascript code integrated to uniGUI Give another professional look to your app Very easy to modify and customize No third party components. All source-code included for Delphi/Pascal/uniGUI. No hidden costs or fees. Yes, we offer advice on adapting any of these examples to your systems. Contact us to receive a quote. See more detail at link below: https://www.unigui.com.br/FavIconMadness.html1 point
-
The world is "Tree" . Run unigui app, open url in browser, and the developer-tool will tell you what is inside it. Type and run “console.log(this)” in developer-tool. (This pic shows how current session objects are organized like a tree inside the browser vm , and "this" is a "Window" type object. ) Every object may have a name ,like O6A,O10....... and MainForm. When you include an outside js file,it's content will append to the "Tree". Example ,we define a function in file "jsfunc.js", function ___js_func_1(){ alert("call js_function"); } and add "/files/jsfunc.js" to servermodule.customfiles. When uniapp initialized, the function "___js_func_1" will append to the object tree (this is "Window"). Or we put an TUniHTMLFrame on a UniForm, set HTML property with: <head> <script> function ___my_func_good(){ alert('good'); } // function append to "Window" var ___mytools={}; // object append to "Window" ___mytools.good=function (){ alert('good'); } //function append to "Window".___mytools </script> </head> <body> hello<br> <input type="button" value="click good" onclick="___my_func_good()"></input> </body> At runtime, "___my_func_good" and "___mytools" will append to the tree (this is "Window"), like pic shows. Usually,we just simple call "this.___js_func_1()", "this.___myfunc_good()" and "this.___mytools.good()". Unisession.AddJs('this.___js_func_1();'); You can add any new child object(or function) to any object on the tree, so it is important to make sure what is "this". If you dynamic create js objects or functions in runtime , you may consider how to organize them on the "Tree"1 point
-
"retired from coding" is already a strange statement, but locking or delete all of already published videos is another thing... and not nice.1 point
-
Updated login demo, now works for Google, Azure and Twitter, enjoy ! SignIn_Demo.zip1 point
-
Oliver Morsch is right, it is working nicely with long polling on the Unigui server, and then the connection will be outbound and no router/NAT issues at all. Attached is a simple setup illustrating this. Then it is all about making the local service run without a hitch - and that is not a Unigui problem I will also propose a namechange: - Uniguni UNIque Graphical User Networking Interface. A little tounge in cheek, of course, but also the chance to launch a press release and define a new term - everybody loves terms. Besides, it is easier to say...and can by time expand to UniGuniLuni, or whatever...the sky is the limit ! polling.zip1 point
-
Here is a modified version of Delphi Developer's solution which scales the number of lines dynamically...obviously there is only so much space to fit eventually. function resize(sender, width, height, oldWidth, oldHeight, eOpts) { var me = sender.btnInnerEl; var tm = new Ext.util.TextMetrics(); var lineHeight = parseInt(me.getStyle("line-height")); var textWidth = tm.getSize(sender.text).width; if (textWidth >= width + 25) { me.setStyle("line-height", lineHeight / Math.ceil(textWidth/width) + "px"); me.setStyle("white-space", "normal"); } else { me.setStyle("white-space", "nowrap"); }; }1 point
-
function TPaginaPrincipal.TextWidth(s: TUniLabel): Integer; var c: TBitmap; f: TFont; begin { uma forma de calcular o tamanho de um texto na janela se o canvas não atualiza via ajax } c := TBitmap.Create; f := TFont.Create; Result := 8 * Length(s.Caption); f.Height := s.Font.Height; f.Size := s.Font.Size; f.Name := s.Font.Name; f.Style := s.Font.Style; try c.Canvas.Font.Assign(f); Result := c.Canvas.TextWidth(s.Caption); finally c.Free; end; end;1 point
-
1 point
-
Not a component for UniGUI, but a good component to use in UniGUI. My current web application needs basic reporting features, so I use this instead of other reporting solutions. So, if anyone needs to export or print a dataset using basic commands, this can help. This component exports any linked dataset to HTML, in disk, then you can show a UniHTMLFrame of it and print. Working here for IE, Chrome and Firefox. The component is attached. Bye! Bruno Lovatti Use like this: procedure TUniFrameInv.CreateHTML(fname: string); begin ToHTML.HTML.Clear; ToHTML.PageOptions.Title := 'Produtos'; ToHTML.PageOptions.Header := 'Produtos da Extrafruti para Inventário <br>' + '<br> LOJA: ' + TrimRight(UniCBoxLoja.Text) + '<br> DATA: ' + FormatDateTime('dd/MMM/yyyy - hh:mm:ss',now) + '<br> ENCARREGADO: ' + UniMainModule.UsuarioLogado; if FileExists(fname) then try SysUtils.DeleteFile(fname); except // end; //ToHTML.PageOptions.Footer := FormatDateTime('dd/MMM/yyyy - hh:mm:ss',now); ToHTML.FileName := fname; // script - test (*ToHTML.Script.Add('<script type="text/javascript">'); ToHTML.Script.Add('$(function(){'); ToHTML.Script.Add(' printPage();'); ToHTML.Script.Add('});'); ToHTML.Script.Add(' function printPage() {'); ToHTML.Script.Add(' focus(); print(); }'); ToHTML.Script.Add('</script>');*) // accents for brazilian portuguese ToHTML.Meta.Clear; ToHTML.Meta.Add('<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />'); ToHTML.Meta.Add('<meta http-equiv="cache-control" content="no-cache" />'); ToHTML.Meta.Add('<meta http-equiv="pragma" content="no-cache" />'); ToHTML.CreateHTML; //ToHTML.SaveHTML; end; Example of call: fname := AppPath + 'impressao\PROD_' + FormatDateTime('dd.mm.yyyy_hh.mm.ss',now)+'_'+ TrimRight(UniCBoxLoja.Text)+'.html'; CreateHTML(fname); And the events like this: procedure TUniFrameInv.ToHTMLAcceptColumn(Field: TField; var Accept: Boolean); var fn: string; begin fn := Field.FieldName; Accept := (fn='COD_PROD_SPALLA') or (fn='COD_PROD_EXT') or (fn='NOME') or (fn='UNIDADE') or (fn='QUANTIDADE') or (fn='QUANTIDADE_DEV') or (fn='DES_GRUPO') or (fn='DES_SUBGRUPO'); end; procedure TUniFrameInv.ToHTMLAcceptRow(Dataset: TDataSet; var Accept: Boolean); begin Accept := true; end; procedure TUniFrameInv.ToHTMLGetColumnWidth(Field: TField; var ColumnWidth: Integer; var ColumnTitle: string); begin if Field.FieldName='COD_PROD_SPALLA' then begin ColumnWidth := 50; ColumnTitle := 'Cód. Spalla'; end else if Field.FieldName='COD_PROD_EXT' then begin ColumnWidth := 50; ColumnTitle := 'Cód. na Loja'; end else if Field.FieldName='NOME' then begin ColumnWidth := 350; ColumnTitle := 'Nome'; end else if Field.FieldName='UNIDADE' then begin ColumnWidth := 10; ColumnTitle := 'Unid.'; end else if Field.FieldName='QUANTIDADE' then begin ColumnWidth := 150; ColumnTitle := 'Estoque'; end else if Field.FieldName='QUANTIDADE_DEV' then begin ColumnWidth := 150; ColumnTitle := 'Devolução'; end else if (Field.FieldName='DES_GRUPO') then begin ColumnWidth := 60; ColumnTitle := 'Grupo'; end else if (Field.FieldName='DES_SUBGRUPO') then begin ColumnWidth := 80; ColumnTitle := 'Subgrupo'; end; end; procedure TUniFrameInv.ToHTMLGetFieldValue(Field: TField; var FieldValue: string); begin if (Field.FieldName='QUANTIDADE') or (Field.FieldName='QUANTIDADE_DEV') then FieldValue := FormatFloat('0.##',Field.AsFloat) else if (Field.FieldName='DES_GRUPO') or (Field.FieldName='DES_SUBGRUPO') then FieldValue := copy(Field.AsString,1,13) else if (Field.FieldName='NOME') then FieldValue := copy(Field.AsString,1,100); end; procedure TUniFrameInv.ToHTMLSummaryRow(Field: TField); begin if Field.FieldName = 'COD_PROD_SPALLA' then Inc(Count); end; procedure TUniFrameInv.ToHTMLSummaryStart; begin Count := 0; end; procedure TUniFrameInv.ToHTMLSummaryText(Field: TField; var SummaryText: string); begin if Field.FieldName = 'COD_PROD_SPALLA' then SummaryText := IntToStr( Count ); end; To open in HTMLFrame (Form ShowLink attached): procedure TUniFrameInv.OpenHTML(fname: string); var url: string; begin url := 'http://' + UniSession.Host + '/impressao/' + ExtractFileName( fname ); UniFormShowLink.UniURL1.HTML.Assign(ToHTML.HTML); UniFormShowLink.ShowModal; end; In the print button ExtEvents of Form ShowLink: function OnClick(sender, e) { var frm = UniFormShowLink.UniURL1.iframe; if (frm) { //zPrint(frm.contentWindow); printIframe(frm); } } DatasetToHTML.zip UnitShowLink.zip1 point