jQWidgets Forums

jQuery UI Widgets Forums Lists DropDownList using text with icons from database

Tagged: 

This topic contains 4 replies, has 3 voices, and was last updated by  Henning 9 years, 7 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
  • using text with icons from database #4894

    jmarais
    Participant

    I know that you can use the following code:
    var source = [
    { html: "

    jqxNumberInput

    ", title: 'jqxNumberInput' }, etc to get the icons displayed but I want to load them form the database.

    Should I generate similar syntax in my php file and send them as a json file or is there a way that after generating the html and the title in an array, to use that in the javascript.

    I have tried different options but it seems that I cannot get the right approach for it to be actually displayed.

    using text with icons from database #4923

    Peter Stoev
    Keymaster

    Hi jmarais,

    If a list item item in the source object defines a property called ‘html’, then the property’s value will be displayed in the item.You should use a syntax like in our sample to load the DropDownList with custom items: textwithicons.htm.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    using text with icons from database #77585

    Henning
    Participant

    Your samples on this site with hardcoded source is very hard to understand.

    To get more new jqwidget users I will suggest more samples with database connections.

    I tried everything like this thread starter with no luck.
    Thread starter had the text “using text with icons from database”
    and the reply was with sample from harcoded source 🙁

            while ($row = $result->fetch_assoc()) {
                $notyper[] = array(
                    'html' => '<b>sample html code</b>',
                    'vavalue'  => $row[vavalue],
                    'vatext'  => utf8_encode($row[vatext])
                );
            }

    Tried this but it don’t display vatext 🙁

                    $("#notype").jqxDropDownList({
                        theme: "boligdata",
                        width: '270',
                        source: notypeAdapter,
                        promptText: "Velg notistype...",
                        valueMember: 'vavalue',
                        displayMember: 'vatext'
                    });
    using text with icons from database #77586

    Henning
    Participant

    This is what we get

    using text with icons from database #77592

    Henning
    Participant

    OK, I think I got it, very simple 🙂

            while ($row = $result->fetch_assoc()) {
                $notyper[] = array(
                    'vavalue'  => $row[vavalue],
                    'vatext'  => "<b>some html here " . utf8_encode($row[vatext]) . "</b>and here"
                );
            }
    

    Thanks anyway 🙂

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

You must be logged in to reply to this topic.