Jump to content

Error in UniListBox, when I click on a ListBox item I need to know its description, but the way it does not appear.


eduardosuruagy

Recommended Posts

  • 4 weeks later...
  • 3 months later...
  • 9 months later...
On 3/27/2020 at 9:08 PM, Farshad Mohajeri said:

Please open a ticket for this. We may implement a workaround.

Something like  LastClickedItem property.

Hello FMSoft,

Really need LastClickedItem property    FSD-2009

Can you please consider it among Top queries.

Many Thx.

Link to comment
Share on other sites

3 hours ago, Sherzod said:

Hello,

Do you mean the last selected item?

Hello Maestro,

Hoping you feel good and all our developers.

Yes,  we need to know the last clicked item (not last checked).

To reproduce  issue :

- OnlyCheckBox = True

- ShowCheckBox = True

MultiSelect = True

it works fine when you check the box, but not when you only select the line.

for example :

onClick event, it  returns a wrong :

uniListBox.itemIndex

Many Thx.

____________

Sorry i am not at office now. i will send a test case tomorrow...

Unigui 1547

Link to comment
Share on other sites

On 2/28/2020 at 8:19 AM, eduardosuruagy said:

Error in UniListBox, when I click on a ListBox item I need to know its description, but the way it does not appear.

 

6 hours ago, Abaksoft said:

Select_Last_idx_lstBox.7z 22.99 kB · 1 download

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;

 

  • Upvote 1
Link to comment
Share on other sites

20 hours ago, Sherzod said:

 

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;

 

 

 

FANTASTIC 

Your code works fine !!!

Really appreciate your efforts Maestro Sherzod :)

Many thx...

 

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...