jQWidgets Forums

jQuery UI Widgets Forums Lists DropDownList Changing Data of DropDown

Tagged: 

This topic contains 8 replies, has 2 voices, and was last updated by  derarnold 11 years, 1 month ago.

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
  • Changing Data of DropDown #53667

    derarnold
    Participant

    Hello hello.

    I develop a simple ticket application. I use a DropDownList to display the attachments to a ticket via databinding. so far so good. My problem is now: how to implement the select statement, so that only the attachments connected to the ticket are shown?

    I think about a sql select statement in the attachment_data.php. But how I get the information about the current ticket into that php file?

    Help is appticiated.

    Oliver

    Changing Data of DropDown #53668

    Peter Stoev
    Keymaster

    Hi Oliver,

    Here’s a small sample which shows how to submit the DropDownList’s Value and how to access it on the Server Side: http://www.jqwidgets.com/jquery-widgets-demo/demos/php/dropdownlist.htm?arctic

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Changing Data of DropDown #53669

    derarnold
    Participant

    Hello Peter.

    Thank you for the reply. That is not exactly whet i am looking for. I try to change the contents of the dropdownfield in accordance with the ticket I have selected. In other words, I want to filter the items in the dropdownlist at server side ….

    Oliver

    Changing Data of DropDown #53671

    Peter Stoev
    Keymaster

    Hi Oliver,

    Well, if your purpose is to rebind it i.e to update its source, then you should create a new instance of jqxDataAdapter and set the jqxDropDownList’s source property to point to the new instance.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Changing Data of DropDown #53685

    derarnold
    Participant

    Hello Peter.

    That is exactly what I want to do. The only thing is, how to pass the id I need to filter.

    So I have

    var dataAdapter_attachments = new $.jqx.dataAdapter(source_attachments);

    and
    var source_attachments =
    {
    datatype: “json”,
    datafields: [
    { name: ‘id’},
    { name: ‘name’},
    ],
    url: ‘attachment_data.php’,
    cache: false,
    };

    So where can I put in this extra information? And how to I get it back in PHP?

    THank you for the help

    Oliver

    Changing Data of DropDown #53734

    Peter Stoev
    Keymaster

    Hi Oliver,

    Look at my first post which points to an example which demonstrates exactly that. The Selected Item’s Value is passed to the server and there’s code which shows how to handle it on the server side.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Changing Data of DropDown #53737

    derarnold
    Participant

    Hello Peter.

    I have a DB containing let say 10 items. With a sql select I want to select only lets say 4 out of these. These 4 should be displayed in the drop box.

    In my php I can already fire this sql statement. For the selection I need a value out of the java script environment (an ID) so I can modify the select statement, so that the correct items are shown. I do now know how to transfer this id …

    Oliver

    Changing Data of DropDown #53747

    derarnold
    Participant

    Hello hello.

    Can I change the URL of the datasource and then force the dropdownlist to reload?

    Oliver

    Changing Data of DropDown #53748

    derarnold
    Participant

    Btw. The Clear Command is not working. Can you perhaps check?

    THX Oliver

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

You must be logged in to reply to this topic.