datawindow原理猜想

来源:互联网 发布:电力人才网络联盟 编辑:程序博客网 时间:2024/04/29 19:16
When you use RowsMove, the rows have the status NewModified! in the target DataWindow.
If you move rows between buffers in a single DataWindow control or DataStore, PowerBuilder retains knowledge of where the rows came from and their status is changed accordingly. For example, if you move unmodified rows from the primary buffer to the delete buffer, they are marked for deletion. If you move the rows back to the primary buffer, their status returns to NotModified!. Note, however, that if you move rows from one DataWindow control (or DataStore) to another and back again, the rows' status is NewModified! because they came from a different DataWindow.

When you use RowsMove, data is not automatically retrieved for drop-down DataWindows in the target DataWindow, as it is when you call InsertRow. You must explicitly call Retrieve for child DataWindows in the target.
When you use RowsCopy or RowsMove to populate another DataWindow, the copied data is not automatically processed by filters or sort criteria in effect on the target DataWindow. You might be required to call the Filter, GroupCalc, or Sort methods to properly process the data.

Uses for RowsMove include:

When you use the RowsCopy method, the status of the rows that are copied to the primary buffer is NewModified!. If you issue an update request, PowerBuilder will send SQL INSERT statements to the DBMS for the new rows.
When you use RowsCopy, data is not automatically retrieved for drop-down DataWindows in the target DataWindow or DataStore, as it is when you call InsertRow. You must explicitly call Retrieve for child DataWindows in the target.
When you use RowsCopy or RowsMove to populate another DataWindow, the copied data is not automatically processed by filters or sort criteria in effect on the target DataWindow. You might be required to call the Filter, GroupCalc, or Sort methods to properly process the data.

将指定行插入或拷贝到目的datawindow(datastore) 指定行的前面,若要插入到最后行,指定行应大于最后行.应为n+1   ,不要指定n ,指定n 的话会插入到n的前面.

Use RowsDiscard when your application is finished with some of the rows in a DataWindow control and you don't want an update to affect the rows in the database. For example, you can discard rows in the delete buffer, which prevents the rows from being deleted when you call Update.
清除指定范围的行,保证这些数据不被更新,不被删除.

Reset is not the same as deleting rows from the DataWindow object or child DataWindow. Reset affects the application only, not the database. If you delete rows and then call the Update method, the rows are deleted from the database table associated with the DataWindow object. If you call Reset and then call Update, no changes are made to the table.
清除所有数据,不影响数据库值

数据窗口 有原始缓冲区 primary!,filter! delete!
retrieve()数据放到原始缓冲区,原始缓冲区内部也应该分为主 过滤 删除区  ,因为当对数据进行删除,过滤时
在原始缓冲区中也做相应的数据从一个区移动到另一个区,以可以使用
datawindowobj.object.data.primary.original[row,col] 
执行update时,应用缓冲区和原始缓冲区数据对比进行insert del update操作.
有可能新增加的数据,或新增的被删除行  在原始中无对应行.(没有测试)
要做比较时一定要判断  rowsstatus
只有datamodified!  才有原始值,才有比较的可能

 
原创粉丝点击