• Alex2018
    November 15, 2017 at 7:31 am #4801

    Hi,

    I am using Type Ahead Text which works fine for me but when I implemented On Change event it fires twice

    Example:  if I have a number 9000011111  . I start clicking in Type Ahead Text 900 then the control finds it and I click on the found item which is 9000011111 the On Change event  fire twice first 900 and then the full number 9000011111 is that correct behavior

    Thanks.

    SPARK Support
    November 15, 2017 at 8:35 am #4802

    Hi Alex,

    I have observed the same behavior.  This is due to the fact that technically, the input for the control has change when the user clicks away from the input field.  The user also happens to be clicking into the popup menu, which sets the value of the input control.  Thus change is actually happening twice.  This is necessary though, as when the user clicks away somewhere else on the screen, the change needs to be fired for evaluation purposes.

    We are looking into providing a method that will return true of false if the value is in the list of items.  Then, the developer can decide whether or not to proceed with the logic in the change event.

    Regards,

    Stephen P.

    Alex2018
    November 15, 2017 at 9:05 am #4803

    Thanks for the quick reply .

    Actually that what I am trying to do  , to find if the item in the list or not 🙂 ok I will ignore then the first event then

    Thanks!

    SPARK Support
    November 15, 2017 at 1:37 pm #4806

    Hi Alex,

    Keep in mind that if the user navigates with the keyboard and selects a list item, the even will only fire once.

    Regards,

    Stephen P.

    Alex2018
    November 15, 2017 at 1:50 pm #4807

    yep, I saw it copy paste only once.

    for now no way to find out if the in the list of items

     

    SPARK Support
    November 15, 2017 at 2:14 pm #4808

    Hi Alex,

    You can check the itemList in context options:

    if(me.context.options.itemList.get(“value”).items.indexOf(me.getData()) > -1){console.log(“On Change triggered”);}

    Regards,

    Stephen P.

    Alex2018
    November 17, 2017 at 10:44 am #4812

    thanks !

    I need to display Modal Alert but that is fine.

    Thank you for all your help!

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.

Start typing and press Enter to search