jQWidgets Forums
jQuery UI Widgets › Forums › Plugins › Data Adapter › Syncing data between dataAdapter and SQL
Tagged: combobox
This topic contains 5 replies, has 2 voices, and was last updated by Peter Stoev 11 years, 7 months ago.
-
Author
-
Hello,
I’m using some data from MYSQL via dataAdapter to create comboBox content. If required item is missing in the combobox I’m using a form to add it. Form submits data in SQL table. What would be the most appropriate way to sync up data between SQL and dataadapter/combobox contect as soon as SQL table is changed?
Thanks
Igor
Hi Igor,
For submitting(syncing) ComboBox with your Server, please check this sample: http://www.jqwidgets.com/jquery-widgets-demo/demos/php/combobox.htm?web
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com/Hi Peter,
Thanks for the feedback. I use exactly the same principle like it is described in the example , however I believe after adding a new record in SQL I need some how to trigger a “reload” of data adapter for my comboBox , it does nto look like it will happen automatically , right?
How can I do that , which method in CombiBox should I be using for that?Thanks in advance
IgorHi Igor,
To refresh the widget’s data source, you will need to set its “source” property again. To update only the dataAdapter, call its dataBind method.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com/Hi Peter,
Thanks for clarification ! So it appears I need to use both of them if need to get data from SQL to update CombiBox , right ?
I have one challenge with this approach though , when I .submit() my form to SQL and immediately try to set “source” property again (i.e. read records from SQL back ) both processes (submitting/and re-reading) happening at the same time (async?) . Is it me that ‘m doing something wrong and there is better approach on how to update data in Combobox after adding a new data in SQL or I need to use different methods to control finishing of submut() and only then starting setting “source” to refresh data.Thanks in advance
IgorP.S. Sorry if this is a bit of off-topic
Hi Igor,
If you want just to refresh a ComboBox which is already bound to a jqxDataAdapter, call the jqxDataAdapter’s dataBind method and the jqxDataAdapter will make a new call to the server and the ComboBox will be reloaded with the new data.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com/ -
AuthorPosts
You must be logged in to reply to this topic.