jQWidgets Forums

jQuery UI Widgets Forums Lists DropDownList Adding an Entry on Top

This topic contains 1 reply, has 2 voices, and was last updated by  Peter Stoev 10 years, 10 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • Adding an Entry on Top #57605

    AJRames
    Participant

    Hello all,

    I am currently facing a problem adding a item to my dropdownlist.
    Here is the code:

                var source =
                {
                    datatype: "xml",
                    datafields: [
                        { name: 'Title', map: 'm\\:properties>d\\:Title', type: 'string' },
                        { name: 'ID', map: 'm\\:properties>d\\:ID', type: 'string' }
                    ],
                    url: url,
                    root: "entry",
                    record: "content"
                };
                var dataAdapter = new $.jqx.dataAdapter(source);
                // Create a jqxDropDownList
                $("#jqxDdlParent").jqxDropDownList(
                    {
                        source: dataAdapter,
                        width: '400',
                        displayMember: "Title",
                        valueMember: "ID"
                    });
                $("#jqxDdlParent").jqxDropDownList('insertAt', { label: '-', value: 0 }, 0);

    The dropdownlist is working well, except of showing the first entry that is added programmatically (‘-‘).

    Can you help me on this?

    Adding an Entry on Top #57611

    Peter Stoev
    Keymaster

    Hi AJRames,

    When you add your item, the data binding is not yet completed. That’s the issue in your code.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

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

You must be logged in to reply to this topic.