Jump to content

Tokay

uniGUI Subscriber
  • Posts

    839
  • Joined

  • Last visited

  • Days Won

    19

Everything posted by Tokay

  1. I need to change a grid filter with code. I attach an example screnshot (main form of the GridFiltering). I added a test button, and a code in it OnClick: UniEdit1.Text := 'bo'. I run app, push the button, and nothig was happened, filter not applied to the grid. Is it possible to do this kind of filtering? Thank you!
  2. Thank you very much! This approach works well. I added as event handler in the TUniEdit, and catch it OnAjaxEvent, and there I get needed coordinates.
  3. http://forums.unigui.com/index.php?/topic/9169-how-to-get-selected-text-from-tunihtmlmemo
  4. I forgot the Execute Method, and have added to the code. Works fine here with TFDQuery too
  5. I understand what happens. Wrong position is obtained only when the TUniEdit is in the container, for example, in the TUniPanel. And this is my case - TUniEdit is the TUniDBGrid column filter.
  6. Thank you for response. Second form shows, but position is wrong. Position is calculated from the form corner not the TUniEdit.
  7. Hmmm, It's strange. I'll try with TFDQuery here.
  8. In the project exist the main form with TUniEdit on it. When I clicked on the TUniEdit I need to show another form in the place where I do click.
  9. At what you need. For example: at show time.
  10. I know how to popup a context menu: if Button = mbRight then UniPopupMenu1.Popup(X, Y, Sender); But how to do it with a Form? How to calculate relative X, Y params to absolute to set Left and Top of the popup Form? ClientToSreen doesn't works. But the Popup Menus can convert X and Y using the Sender.
  11. If I understand correctly, it could fix old and ugly issue "Attempt to access nil session reference". At least partially. You can store your current session ID and get it later in any code.
  12. I was constantly missing feature of find defined session. It very important in some cases. I show you idea (if I understand all properly): unit Main; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Uni, uniGUITypes, uniGUIAbstractClasses, uniGUIClasses, uniGUIRegClasses, uniGUIForm; //this case shows how to run a long query without stopping the interface //additional thread for query type THelpThread = class(TThread) private FQuery: TUniQuery; FSessionName: string; protected procedure Execute; override; public property Query: TUniQuery Read FQuery Write FQuery; property SessionName: string Read FSessionName Write FSessionName; end; type TMainForm = class(TUniForm) UniQuery1: TUniQuery; UniDataSource1: TUniDataSource; UniDBGrid1: TUniDBGrid; private FThread: THelpThread; procedure Thread1Finish(Sender: TObject); procedure StartCalcThread(const s: string); procedure AssignDataSet; { Private declarations } public { Public declarations } end; function MainForm: TMainForm; implementation {$R *.dfm} uses uniGUIVars, MainModule, uniGUIApplication; function MainForm: TMainForm; begin Result := TMainForm(UniMainModule.GetFormInstance(TMainForm)); end; { THelpThread } procedure THelpThread.Execute; begin inherited; if Query.State <> dsInactive then Query.Close; if not Query.Transaction.Active then Query.Transaction.StartTransaction; Query.Open; end; { TMainForm } procedure TMainForm.StartCalcThread(const s: string); begin //startin of query thread if not Assigned(FThread) then begin //the query UniQuery1.SQL.Clear; UniQuery1.SQL.Add('select MAPS.MAPS_SOURCE,'); UniQuery1.SQL.Add(s); UniQuery1.SQL.Add('from MAPS'); UniQuery1.SQL.Add('group by MAPS_SOURCE'); UniQuery1.SQL.Add('union'); UniQuery1.SQL.Add('select "all",'); UniQuery1.SQL.Add(s); UniQuery1.SQL.Add('from MAPS'); //off the grid DataSource UniDBGrid1.DataSource := nil; FThread := THelpThread.Create(True); FThread.Query := UniQuery1; FThread.OnTerminate := Thread1Finish; FThread.FreeOnTerminate := True; //store the session ID {!!!!} FThread.SessionName := UniSession.SessionId; //start querying FThread.Start; end; end; procedure TMainForm.Thread1Finish(Sender: TObject); begin //sync assigned of dataset with the grid TThread.Synchronize(nil, AssignDataSet); FThread := nil; end; procedure TMainForm.AssignDataSet; var Session: TUniGUISession; lMainModule: TUniMainModule; begin //find session by ID {!!!!} Session := UniServerModule.GetSession(FThread.SessionName); //get defined MainModule of session lMainModule := TUniMainModule(Session.UniApplication.UniMainModule); //get defined MainForm of session with TMainForm(lMainModule.GetFormInstance(TMainForm)) do //assigne dataset and DataSource with grid UniDBGrid1.DataSource := UniDataSource1; end; initialization RegisterAppFormClass(TMainForm); end.
  13. Did you add the code to the afterrender function as I described above? It must be added to each TUniHTMLMemo.
  14. I just try with 1528 version. Works fine here.
  15. Нет. Работает согласно рекомендаций Майкрософт хранить данные в реестре. Дальше спорить действительно смысла не имеет.
  16. Indy could encode end decode base64, you can google how to do it: base64 indy delphi
  17. В чем кошмар то? Отлично работает всё.
  18. Нет, конечно. Поюзерно хранится в реестре.
  19. 1. Я эти данные храню в реестре, а не в базе. 2. Пользователей у нас сотни и по 50-100 столбцов в гриде. Нагрузки в общем можно сказать что и нет. 3. Дополнительной нагрузки на http не будет потому что после любого изменения они всегда синхронно отражаются на стороне бэка, будешь ли ты к этим свойствам обращаться или нет - не имеет вообще никакого значения. 4. Если уж хочется оптимизации, то точно не стоит это делать событиями. А вот спрашивать и просить признак того, что были изменения в гриде вообще, по которому опционально и сохранять данные. Пока ты делаешь методом 'в лоб', это не оптимизация а непонятно что.
  20. Что-то ты куда-то в дебри полез Я делаю проще (так же как в вингуе): при закрытии сохраняю состояние всех столбцов. При открытии восстанавливаю состояние. Всё происходит на серверной стороне несколькими строками кода в общем-то. Никаких дополнительных действий со стороны пользователя делать не нужно вообще, ну и обработки событий тоже не нужно, только открытие/закрытие формы.
  21. Most of the Delphi and third-part functions and libraries except visual (VCL/FMX) are acceptable. With some restrictions (mostly from the security).
  22. Идея отличная. Виндовые гриды часто так и работают. Удобно. Другой вариант: сделать в углу просто кнопку + по клику отображать окно со списком полей с возможностью включения, отключения и драг-дропа для смены последовательности полей в гриде.
  23. Конечно же глобальные переменные модуля не могут быть по-клиентскими, а вот поля по-клиентских экземпляров UniMainModule могут и будут.
  24. В форках можно найти свежее: https://github.com/landrix/php4delphi https://github.com/suwermave/php4delphi https://github.com/glaidsen-ds/php4delphi https://github.com/StranikS-Scan/php4delphi Тем не менее вопрос целесообразности разбираться с 'добром' сложный. Возможно проще переписать.
×
×
  • Create New...