jQWidgets Forums
jQuery UI Widgets › Forums › Lists › DropDownList › Changing Data of DropDown
Tagged: DropDownList
This topic contains 8 replies, has 2 voices, and was last updated by derarnold 11 years, 1 month ago.
-
Author
-
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
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 StoevjQWidgets Team
http://www.jqwidgets.comHello 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
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 StoevjQWidgets Team
http://www.jqwidgets.comHello 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
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 StoevjQWidgets Team
http://www.jqwidgets.comHello 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
Hello hello.
Can I change the URL of the datasource and then force the dropdownlist to reload?
Oliver
Btw. The Clear Command is not working. Can you perhaps check?
THX Oliver
-
AuthorPosts
You must be logged in to reply to this topic.