Frega Posted July 22, 2019 Share Posted July 22, 2019 Hello! first topic in here, I'm an IT guy on a small business and I have the need to build up a Intranet for our ~10 man team to communicate and load some data from our ERP software, so I'm testing some options, unigui is one of them because Unigui and delphi seems to be extremly productive in comparison to asp.net / php frameworks So let's cut the crap, I've download downloaded the trial and did some homework, here's some of my doubts by now: 1st: I pretend to use Unigui with the UniPageControl/Frames to do some tabs inside the page but some of the frames like let's say "InvoiceDetail" I'll need to open one two or more instances at once, one for each different Invoice. for that test I did this way: procedure NewTab(AFrame : TFrame;ATitle:string;Aid:integer); ... //creation of the TabSheet and other stuffs FCurrentFrame:= TUniFrameClass(AFrame).Create(Self); with FCurrentFrame do begin Name := Name+IntToStr(Aid); Tag := ATag; Align := alClient; Parent := TabSheet; end; end; I Create the FRAME and then I renamed it because I CAN'T have two frames with the same name, so, to overcome this issue I inserted the Invoice ID on the end of the InvoiceDetail, now InvoiceDetail became InvoiceDetail400 InvoiceDetail500 InvoiceDetailN and so on... The problem is that those Frames will need some ajaxRequest to be sent to the sever and on the client side on JS I can't find the correct name of the Frame to send like ajaxRequest(InvoiceDetail400,'EventName',[params]); how do I retrieve the correct frame name? 2nd: I already bought the FontAwesome 5 and it seems that uniGUI uses the free by default. Is there a way to remove the embbeded FA Free so the page won't load this two css's files? (5.0 and 4.7 free). I don't like this kind of mess and waste of resources. 3rd: Is there a complete documentation? (Example: I don't understand, what is UniHTMLFrame.AfterScript , when it runs? after the page is loaded? Is there a documentation about that?) Regards, Frega W. Quote Link to comment Share on other sites More sharing options...
Hayri ASLAN Posted July 23, 2019 Share Posted July 23, 2019 1- How you adding client side events? 2- We need to add this functionality. For now you can delete font-awesome folder in "C:\Program Files (x86)\FMSoft\Framework\uniGUI\ext-6.7.0\build\packages" 3-http://unigui.com/resources/online-documentation/component-reference-manual Quote Link to comment Share on other sites More sharing options...
Frega Posted July 23, 2019 Author Share Posted July 23, 2019 9 hours ago, Hayri ASLAN said: 1- How you adding client side events? 2- We need to add this functionality. For now you can delete font-awesome folder in "C:\Program Files (x86)\FMSoft\Framework\uniGUI\ext-6.7.0\build\packages" 3-http://unigui.com/resources/online-documentation/component-reference-manual I'm much apreciated with your help ASLAN! 1. Some frames I'm experimenting with third party components to test compatibility, So this "InvoiceDetail" is a case where I'm trying to load a 3rdparty datagrid using a UniHTMLFrame inside of the InvoiceDetail Frame... all the client JS script and grid calls are in a html file. procedure TInvoiceDetail.UniFrameCreate(Sender: TObject); begin HTMLFrame1.HTML.Loadfromfile('something.html'); end; procedure TConsultaPedido.HTMLFrame1AjaxEvent(Sender: TComponent; EventName: string; Params: TUniStrings); begin if EventName='LoadInvoiceGrid' then LoadInvoiceGrid; //In this procedure I load the Invoice Itens from database and then loop it with TJsonObject to write a JSON and then send to back via unisession.response(json); end; something.html: <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <body class="dx-viewport"> <div id="gridContainer"></div> </body> <script> $(function(){ var GetInvoice = function() { result=ajaxRequest(InvoiceDetail.HTMLFrame1,'LoadInvoiceGrid',[],false); //ajaxRequest return JSON.parse(result.responseText); //parse to json to send to the dxDataGrid. } $("#gridContainer").dxDataGrid({ dataSource: GetInvoice(); //This GetInvoice function return a JSON with the grid data that is feed into the grid. ... //rest of the grid config. }); </script> hope you understand the whole context Am I doing it "wrong"? do you have a better way? Quote Link to comment Share on other sites More sharing options...
Hayri ASLAN Posted July 24, 2019 Share Posted July 24, 2019 Hi I think instead of calling ajaxrequest with false(wait response), you should create a store and assign loadUrl. This is what we do in our grids. Check UniDBGrid.pas https://js.devexpress.com/Documentation/ApiReference/UI_Widgets/dxDataGrid/Configuration/#dataSource 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.