This is the effect: First Last Birth Death Origin Hector Berlioz 1803 1869 France Modest Moussorgsky 1839 1881 Russia Franz Liszt 1811 1886 France Antonio Vivaldi 1678 1741 Italy Johann Sebastian Bach 168 5 1750 Germany Ludwig van Beethoven 1770 1827 Germany Wolfgang Amadeus Mozart 1756 1791 Austria Joseph Haydn 1732 1809 Germany Claude Debussy 1862 1918 France
The third step: dynamic addition, deletion, etc. of data (object model) Of course Binding can be dynamic: In script: span1.dataSrc = "#dsoComposer"; span1.dataFld = "compsr_first";
html is like this:
And you can access the ado of the data source: var oRecordSet = dsoComposer.recordset; Of course there is oRecordSet .MoveNext and so on.
For example: onclick="tdcComposers.recordset.MoveFirst()"> onclick="tdcComposers.recordset.MovePrevious(); if (tdcComposers.recordset.BOF) tdcComposers.recordset.MoveFirst();"> ; onclick="tdcComposers.recordset.MoveNext(); if (tdcComposers.recordset.EOF) tdcComp osers.recordset .MoveLast();"> onclick="tdcComposers.recordset.MoveLast()">
It can also be used like this:
Just add and delete records : oRecordSet.AddNew() and oRecordSet.Delete().
Step 3: Respond to various data events (event model) How to handle the data accordingly after it changes? The method provided in msdn is as follows:
These are the list of event names:
Event Bubbles Cancelable Applies to Introduced In Internet Explorer Version onbeforeupdate True True bound elements 4.0 onafterupdate True False bound elements 4.0 onrowenter True False D SO 4.0 onrowexit True False DSO 4.0 onbeforeunload False False window 4.0 ondataavailable True False DSO 4.0 ondatasetcomplete True False DSO 4.0 ondatasetchanged True False DSO 4.0 onerrorupdate True True bound elements 4.0 onreadystatechange True False DSO 4.0 oncellchange True False DSO 5.0 onrowsinserted True False DSO 5.0 onrowsdelete True False DSO 5.0 How about ? I think http://msdn.microsoft.com/workshop/samples/author/databind/dbevts.htm is a relatively comprehensive example of application. If you study it carefully, you will definitely gain something.
There are many examples of using data binding to achieve paging on the Internet. In fact, data binding can do more things, right? There should be very large applications in rich clients, such as making very complex datagrids.
What I want to find out more now is how to easily achieve synchronization with the server, because the client's data binding has no impact on the server (you can generate data sources from the server, but the operations on the client do not will automatically return to the server), msdn says that RDS can be used, but this method is too clumsy and unsafe.