提交 066881b9 编写于 作者: 蔡祥熠

Merge branch 'fix/api_table_addRow' into 'develop'

Merge of fix/api_table_addRow  Table的api中加入addRow以支持单条插入 to develop

See merge request o2oa/o2oa!493
......@@ -2055,6 +2055,9 @@ MWF.xScript.createTable = function(){
this.insertRow = function(data, success, error, async){
this.action.rowInsert(this.name, data, success, error, async);
};
this.addRow = function(data, success, error, async){
this.action.rowInsertOne(this.name, data, success, error, async);
};
this.updateRow = function(id, data, success, error, async){
this.action.rowUpdate(this.name, id, data, success, error, async);
};
......
......@@ -3641,6 +3641,9 @@ MWF.xScript.createTable = function(){
this.insertRow = function(data, success, error, async){
this.action.rowInsert(this.name, data, success, error, async);
};
this.addRow = function(data, success, error, async){
this.action.rowInsertOne(this.name, data, success, error, async);
};
this.updateRow = function(id, data, success, error, async){
this.action.rowUpdate(this.name, id, data, success, error, async);
};
......
......@@ -2261,6 +2261,9 @@ if (!MWF.xScript.createTable) MWF.xScript.createTable = function(){
this.insertRow = function(data, success, error, async){
this.action.rowInsert(this.name, data, success, error, async);
};
this.addRow = function(data, success, error, async){
this.action.rowInsertOne(this.name, data, success, error, async);
};
this.updateRow = function(id, data, success, error, async){
this.action.rowUpdate(this.name, id, data, success, error, async);
};
......
......@@ -5191,12 +5191,45 @@ MWF.xScript.ViewEnvironment = function (ev) {
* });
*/
/**
* 往数据表中插入单条数据。
* @method addRow
* @methodOf module:Table
* @instance
* @param {Object} data 需要插入的数据。
* @param {Function} [success] 调用成功时的回调函数。
* @param {Function} [failure] 调用错误时的回调函数。
* @param {Boolean} [async] 是否异步调用,默认为true。
* @o2syntax
* table.addRow( data, success, failure, async )
* @example
* var table = new this.Table("table1");
* var data = {
* "subject": "标题一",
* ... //其他字段
* };
* table.addRow( data, function(data){
* //data 形如
* //{
* // "type": "success",
* // "data": {
* // "id": 2cf3a20d-b166-490b-8d29-05544db3d79b //true表示修改成功
* // },
* // "message": "",
* // "date": "2021-11-01 18:32:27"
* //}
* }, function(xhr){
* //xhr 为 xmlHttpRequest
* });
*/
/**
* 往数据表中修改单条数据。
* @method updateRow
* @methodOf module:Table
* @instance
* @param {String} id 需要修改的数据id。
* @param {Object} data 需要修改的数据。
* @param {Function} [success] 调用成功时的回调函数。
* @param {Function} [failure] 调用错误时的回调函数。
* @param {Boolean} [async] 是否异步调用,默认为true。
......@@ -5258,6 +5291,9 @@ MWF.xScript.createTable = function(){
this.insertRow = function(data, success, error, async){
this.action.rowInsert(this.name, data, success, error, async);
};
this.addRow = function(data, success, error, async){
this.action.rowInsertOne(this.name, data, success, error, async);
};
this.updateRow = function(id, data, success, error, async){
this.action.rowUpdate(this.name, id, data, success, error, async);
};
......
......@@ -2553,12 +2553,48 @@ bind.Table = function(name){
this.insertRow = function(data, success, error, async){
this.action.rowInsert(this.name, data, success, error, async);
};
/**
* 往数据表中插入单条数据。
* @method addRow
* @methodOf module:Table
* @instance
* @param {Object} data 需要插入的数据。
* @param {Function} [success] 调用成功时的回调函数。
* @param {Function} [failure] 调用错误时的回调函数。
* @o2syntax
* table.addRow( data, success, failure, async )
* @example
* var table = new this.Table("table1");
* var data = {
* "subject": "标题一",
* ... //其他字段
* };
* table.addRow( data, function(data){
* //data 形如
* //{
* // "type": "success",
* // "data": {
* // "id": 2cf3a20d-b166-490b-8d29-05544db3d79b //true表示修改成功
* // },
* // "message": "",
* // "date": "2021-11-01 18:32:27"
* //}
* }, function(xhr){
* //xhr 为 xmlHttpRequest
* });
*/
this.addRow = function(data, success, error, async){
this.action.rowInsertOne(this.name, data, success, error, async);
};
/**
* 往数据表中修改单条数据。
* @method updateRow
* @methodOf module:server.Table
* @instance
* @param {String} id 需要修改的数据id。
* @param {Object} data 需要修改的数据。
* @param {Function} [success] 调用成功时的回调函数。
* @param {Function} [failure] 调用错误时的回调函数。
* @o2syntax
......
......@@ -912,6 +912,9 @@ bind.Table = function(name){
this.insertRow = function(data, success, error, async){
this.action.rowInsert(this.name, data, success, error, async);
};
this.addRow = function(data, success, error, async){
this.action.rowInsertOne(this.name, data, success, error, async);
};
this.updateRow = function(id, data, success, error, async){
this.action.rowUpdate(this.name, id, data, success, error, async);
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册