jQuery UI Widgets Forums Plugins Data Adapter Syncing data between dataAdapter and SQL

Tagged: 

This topic contains 5 replies, has 2 voices, and was last updated by  Peter Stoev 6 years, 11 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author

  • kingaru
    Participant

    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

     


    Peter Stoev
    Keymaster

    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 Stoev

    jQWidgets Team
    http://www.jqwidgets.com/

    Syncing data between dataAdapter and SQL #26685

    kingaru
    Participant

    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
    Igor


    Peter Stoev
    Keymaster

    Hi 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 Stoev

    jQWidgets Team
    http://www.jqwidgets.com/

    Syncing data between dataAdapter and SQL #26882

    kingaru
    Participant

    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
    Igor

    P.S. Sorry if this is a bit of off-topic

    Syncing data between dataAdapter and SQL #26883

    Peter Stoev
    Keymaster

    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 Stoev

    jQWidgets Team
    http://www.jqwidgets.com/

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

You must be logged in to reply to this topic.