Jump to content

Recommended Posts

Posted

Hi @Sherzod

Is it possible to add a  toggle (Yes / No) on each UnimDBListGrid record  like Mega DEMO  :    Grid - WidgetColumn2   ?

Something like this where user can switch (Yes / No) directly on the record :

Thx.

 

1.png

  • Upvote 2
  • Abaksoft changed the title to Toggle on UnimDBListGrid ?
  • 1 month later...
Posted

Good morning @Sherzod

I finded a way to add a Button on each row on GetText :

procedure TMainmForm.ClientDataSet1ClientGetText(Sender: TField;
  var Text: string; DisplayText: Boolean);
begin

  Text :=Sender.AsString +

   ' <button id="myid' + intToStr(ClientDataSet1.RecNo) + '">' +
          '  Show' +
          '</button>' +


//*******************************
          ' <script>' +

          '  document.getElementById("myid' + intToStr(ClientDataSet1.RecNo) + '").addEventListener("click", function () {' +
          '    ajaxRequest(MainmForm.UnimDBListGrid1, "MyEvent2", []);' +
          '  });' +

          ' </script>';
//*******************************

end;

 

Also,  I managed to retrieve the click event from AjaxEvent (on an UnimHTMLFrame), but not for UnimDBListGrid.

What i am doing wrong ?

Could you please analyze this prg in attachment.

Many Thx

 

UnimDBListGrid_Ajax_Event.7z

Posted

Hi @Abaksoft

Try:

procedure TMainmForm.ClientDataSet1ClientGetText(Sender: TField;
  var Text: string; DisplayText: Boolean);
var
  RowId: string;
begin
  RowId := IntToStr(ClientDataSet1.RecNo);
  Text := Sender.AsString +
    ' <button onclick=''ajaxRequest(MainmForm.UnimDBListGrid1, "MyEvent2", ["row=' + RowId + '"])''>' +
    ' Show' +
    '</button>';
end;

 

  • Upvote 1
Posted
44 minutes ago, Sherzod said:

Hi @Abaksoft

Try:

procedure TMainmForm.ClientDataSet1ClientGetText(Sender: TField;
  var Text: string; DisplayText: Boolean);
var
  RowId: string;
begin
  RowId := IntToStr(ClientDataSet1.RecNo);
  Text := Sender.AsString +
    ' <button onclick=''ajaxRequest(MainmForm.UnimDBListGrid1, "MyEvent2", ["row=' + RowId + '"])''>' +
    ' Show' +
    '</button>';
end;

 

Wow...

Great, You're a key player in Unigui !!!

We'll always need you.

Many Thx Maestro :)

  • Thanks 1
×
×
  • Create New...