jQWidgets Forums

jQuery UI Widgets Forums Lists ComboBox SHOW innerHTML when filter data

Tagged: 

This topic contains 5 replies, has 2 voices, and was last updated by  Peter Stoev 11 years, 1 month ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
  • SHOW innerHTML when filter data #50795

    Deneb Asecas
    Participant

    Hi, at First sorry my bad english. I’ll do my best to be clear.

    I load my combobox by jQuery.ajax. I bring the data from postgresql converted in HTML format because I have some problems with accents in my website. The language is Spanish, so the accents are most needed. For example:

    María leave from my database and comes to my web page as “Mar & i acutea” without the space obviously XD.

    The combobox shows me the information exactly as I wish, with appropriate accents, but when I go to search for text containing accents shows me the html code.

    Is there any way to load the innerHTML of the combobox in the filter or something that shows me the accents in a normal format?… let me show you an image

    http://i58.tinypic.com/242tr0o.jpg

    SHOW innerHTML when filter data #50807

    Peter Stoev
    Keymaster

    Hi Deneb Asecas,

    The text displayed in the Input Field from the auto-complete can be customized by using the “renderSelectedItem” callback function. Example: http://jsfiddle.net/jqwidgets/v6WqF/

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    SHOW innerHTML when filter data #50867

    Deneb Asecas
    Participant

    Thank you a lot, but, excuse me, I’m new working with jquery. I understand a lot of things about it, but not at all nor why their behavior.

    I’m trying what you recommended to me. I have done the following. I created a hidden input text to use its innerHTML property. Just like as I show below. I do not know if is correct.

    renderSelectedItem: function(index, item)
    {
    document.getElementById(‘auxiliar’).innerHTML = item.label;
    return document.getElementById(‘auxiliar’).innerHTML;
    }

    I just trying to return the innerHTML text.

    Actually, I dont understand why the combobox show correctly when is displayed, but, it shows itself in html format when filter. Why is that happens?

    Why not sample equally load both deployed as the search?

    SHOW innerHTML when filter data #50872

    Peter Stoev
    Keymaster

    Hi Deneb Asecas,

    The “renderSelectedItem” allows you to override the built-in behavior. The method is raised when the selection is changed. You can return any Text as a result, not HTML, because Text is what Input fields display.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    SHOW innerHTML when filter data #51097

    Deneb Asecas
    Participant

    Hi again, I really apologize because I do not know if I do not explain correctly or I really do not understand what you are trying to explain to me. I do not speak much English. I really really apologize. I will try to explain in another way to see if we can solve my problem. I appreciate all time you spent on my problem.

    My problem is not when I select an item on the combobox. The problem is when I try to filter the combobox. When I do this, the text displayed is in HTML format, I do not need to select the item, I just need to find it when I type words as filter, but, as I said, the filter display the text in HTML format and cause me a problem.

    Let me try an example:

    I want to find every item start with “C…”. I can see every item that star with “C”.

    Now, I want to find every item start with “Có…”. I can not see the items because the filter is doing something wrong. The say to me: “Sorry, there is not an item start with Có”, but actually there is it. I can find every items start with “Có” if I do something like “C& oacute;” and not “Có″… I want type “Có″ no ” C& oacute;”

    SHOW innerHTML when filter data #51123

    Peter Stoev
    Keymaster

    Hi Deneb,

    And to modify the text displayed in the ComboBox’s text field/filter field/autocomplete field, you should implement “renderSelectedItem” function. Ex: http://jsfiddle.net/jqwidgets/v6WqF/

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

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

You must be logged in to reply to this topic.