Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/30/21 in all areas

  1. Hi AfterScroll event of dataset?
    1 point
  2. FANTASTIC Your code works fine !!! Really appreciate your efforts Maestro Sherzod Many thx...
    1 point
  3. Hello, Can you try this approach for now? 1. UniListBox1 -> ClientEvents -> ExtEvents -> function afterrender(sender, eOpts) { sender.getEl().dom.addEventListener('click', function(e) { if (e.target && e.target.classList[0] == 'x-boundlist-item') { ajaxRequest(sender, '_click', ['dataindex='+e.target.getAttribute('data-recordindex')]); } }); } 2. UniListBox1 -> OnAjaxEvent procedure TMainForm.UniListBox1AjaxEvent(Sender: TComponent; EventName: string; Params: TUniStrings); begin if EventName = '_click' then (Sender as TUniListBox).CustomAttribs.Values['dataindex'] := Params.Values['dataindex']; end; 3. UniListBox1 -> OnClick procedure TMainForm.UniListBox1Click(Sender: TObject); begin UniEdit1.Text := (Sender as TUniListBox).CustomAttribs.Values['dataindex']; end;
    1 point
  4. Here is the code above a bit modified and without the bugs (this time for the mobile version): PROCEDURE TUniMainModule.StringExplode(s : STRING; Delimiter : STRING; VAR res : TStringList); BEGIN res.Clear; res.Text:=StringReplace(s, Delimiter, #13#10, [rfIgnoreCase, rfReplaceAll]); END; PROCEDURE TUniMainModule.SaveGridLayout(Mydbgrid : TUnimDBGrid); VAR filename : STRING; lines : TStringList; i : INTEGER; my_visible : STRING; BEGIN Filename:=UniServerModule.StartPath+'GRID'+IntToStr(Mydbgrid.Tag)+'.INI'; TRY lines:=TStringList.Create; WITH Mydbgrid DO BEGIN FOR i:=0 TO Mydbgrid.Columns.count-1 DO BEGIN IF Mydbgrid.Columns[i].Visible=TRUE THEN my_visible:='T' ELSE my_visible:='F'; lines.Add( Mydbgrid.Columns[i].DisplayName+';;' +IntToStr(Mydbgrid.Columns[i].Width)+';;' +Mydbgrid.Columns[i].Title.Caption+';;' +my_visible); END; END; lines.SaveToFile(fileName); FINALLY lines.free; END; END; PROCEDURE TUniMainModule.LoadGridLayout(Mydbgrid : TUnimDBGrid); VAR filename : STRING; lines : TStringList; columnInfo : TStringList; lineCtr : INTEGER; colIdx : INTEGER; cnt : INTEGER; BEGIN Filename:=UniServerModule.StartPath+'GRID'+IntToStr(Mydbgrid.Tag)+'.INI'; IF NOT TFile.Exists(Filename) THEN Exit; TRY lines:=TStringList.Create; columnInfo:=TStringList.Create; lines.LoadFromFile(fileName); FOR lineCtr:=0 TO lines.count-1 DO BEGIN IF trim(lines[lineCtr])<>'' THEN BEGIN StringExplode(lines[lineCtr], ';;', columnInfo); cnt:=Mydbgrid.Columns.count; // go through all the columns, looking for the one we are currently working on FOR colIdx:=0 TO cnt-1 DO BEGIN // once found, set its width and title, then its index (order) IF Mydbgrid.Columns[colIdx].FieldName=columnInfo[0] THEN BEGIN Mydbgrid.Columns[colIdx].Width:=StrToInt(columnInfo[1]); Mydbgrid.Columns[colIdx].Title.Caption:=columnInfo[2]; IF columnInfo[3]='T' THEN Mydbgrid.Columns[colIdx].Visible:=TRUE ELSE Mydbgrid.Columns[colIdx].Visible:=false; Mydbgrid.Columns[colIdx].Index:=lineCtr; END; END; END; END; FINALLY lines.free; IF assigned(columnInfo) THEN columnInfo.free; END; END; To make it work, put this code into your MainModule, add "unimDBGrid" and "System.IOUtils" into the uses segment and give every grid in your app a different Tag-property. Use LoadGridLayout / SaveGridLayout with the corresponding grid. It's recommend to load all grids in the FormShow-event and save them in the FormCloseEvent. For desktop-version change "TUnimDBGrid" to "TUniDBGrid".
    1 point
  5. I have a server with a local Bussiness Intelligence service and unigui running on that server also. I would like that BI server not to be accesible from outside the server, so I only would access it from localhost inside the server. My unigui application is accesible from outside the server, and my question is... Can I create a urlframe or htmlframe inside the unigui application that browse my BI service from the server ad show the result to the client?
    1 point
×
×
  • Create New...