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.


Recommended Posts

Posted

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

See that in the attached image I marked option 5 and even so in the onclick event he shows me option 1.

UniListBox1.Items.Strings[UniListBox1.ItemIndex]

Posted
44 minutes ago, eduardosuruagy said:

See that in the attached image

?

45 minutes ago, 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.

Can you clarify your question?

Posted
2 minutes ago, eduardosuruagy said:

This example is what comes with Unigui, I just made some changes to try to get what I wanted.

Sorry, are you using the latest build?

  • 4 weeks later...
  • 3 months later...
Posted
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.

Hi Farshad,

Any news FSD-2009 ?

(Steel not implemented in Build 1534).

  • 9 months later...
Posted
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.

Posted
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

Posted
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
Posted
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

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...