Property Editor textChanged event in angular

8 posts, 1 answers
  1. Nick
    Nick avatar
    13 posts
    Member since:
    Jun 2017

    Posted 10 Jul Link to this post

    Is there an event I can subscribe to on the tkPropertyEditor to know when the value in the editor has changed, or when a value has been selected from the inlineautocomplete picker? I haven't found anything in the documentation about what events are available for the propertyeditors.

    Here's what I'm trying to do: using the inlineautocomplete editor, I'd like to update the valuesprovider list whenever the text within the editor changes, then respond to the selection whenever the user picks an item from the picker.

  2. nikolay.tsonev
    Admin
    nikolay.tsonev avatar
    286 posts

    Posted 11 Jul Link to this post

    Hi Nick,
    thank you for contacting us.

    I reviewed your case and if I understand you correctly you are using DataForm component with Editor type "AutoCompleteInline" and you are looking for an event, which will be fired when a new item is picked from the available options.

    In this case you could use propertyCommittedEvent, which will notify you when the value of the editor is changed. For further info, you could review the documentation here or this example.

    Hope this information helps

    Regards,
    nikolay.tsonev
    Progress Telerik
    Did you know that you can open private support tickets which are reviewed and answered within 24h by the same team who built the components? This is available in our UI for NativeScript Pro + Support offering.
  3. Nick
    Nick avatar
    13 posts
    Member since:
    Jun 2017

    Posted 11 Jul in reply to nikolay.tsonev Link to this post

    Thanks for the response. I did see that event, but it doesn't seem to be quite what I'm looking for. I'm looking for an event that fires when the editor's text is changed, and not necessarily when the property is committed to the bound [source] object. Something like (changed) or (textChange) perhaps?

    This would let me update the AutoCompleteInline's valuesprovider based on the current text in the control, even if the dataForm's commit-mode is set to manual or OnLostFocus. The end result here is that I could modify the autocomplete suggestion list dynamically as the user types based on the current text they have entered.

  4. Answer
    nikolay.tsonev
    Admin
    nikolay.tsonev avatar
    286 posts

    Posted 11 Jul Link to this post

    Hi,

    Indeed it is not currently possible to handle text change for the DataForm fields.

    Regarding that, it would help if you could provide some more info about your specific case, the need of handling text change and what is the expected final result.
    This will help us to understand your scenario and we may consider exposing such event for future releases.

    Bear in mind that at this moment the Editor if type  AutoCompleteInline, will filter the suggestions based on the current input

    Best Regards,
    nikolay.tsonev
    Progress Telerik
    Did you know that you can open private support tickets which are reviewed and answered within 24h by the same team who built the components? This is available in our UI for NativeScript Pro + Support offering.
  5. Nick
    Nick avatar
    13 posts
    Member since:
    Jun 2017

    Posted 12 Jul in reply to nikolay.tsonev Link to this post

    Okay thanks, that's good to know; I'll stop trying to figure it out.

    As for my specific case, I have a component I built that updates a list of suggestions (addresses, in this case) when the user types into a textfield. Since the suggestions come from a web service based on the currently entered text, I can't populate the suggestion source (valuesprovider) statically. So it would be nice to edit the source object using the telerik DataForm, but until there's a mechanism to react to editor text changes, I'll need to use my current solution.

  6. nikolay.tsonev
    Admin
    nikolay.tsonev avatar
    286 posts

    Posted 13 Jul Link to this post

    Hello Nick,

    In your specific scenario, I could suggest downloading all the needed information from the web service and while binding valuesProvider property. This will allow you to setup all suggestion runtime from code behind after the data has been download from the DB. Something more for this case you could add all addresses, which will be filtered regarding the input.

    A Very similar example could be found here, for the DataForm field named "from".

    Let me know, whether this is applicable for you.


    Regards,
    nikolay.tsonev
    Progress Telerik
    Did you know that you can open private support tickets which are reviewed and answered within 24h by the same team who built the components? This is available in our UI for NativeScript Pro + Support offering.
  7. Nick
    Nick avatar
    13 posts
    Member since:
    Jun 2017

    Posted 13 Jul in reply to nikolay.tsonev Link to this post

    That solution won't work in this case, I'm afraid. The suggestions are obtained via a query to Google's Places API. So the suggestion pool is essentially "all" addresses. The only limiting factor on that set is the current text input.
  8. nikolay.tsonev
    Admin
    nikolay.tsonev avatar
    286 posts

    Posted 14 Jul Link to this post

    Hi Nick,

    Indeed this downloading all available addresses from Google Place API will not be an appropriate solution.

    Regarding that, I have logged new feature request about implementing functionality, which allows handling text changing. You could keep track on it for further info.

    Best Regards,
    nikolay.tsonev
    Progress Telerik
    Did you know that you can open private support tickets which are reviewed and answered within 24h by the same team who built the components? This is available in our UI for NativeScript Pro + Support offering.
Back to Top