Solved another problem of UFIDA A6 2.75.

Source: Internet
Author: User

Today, I found another issue with OA: when modifying a prepared document, you cannot delete the content of the existing duplicate table, but you can add a new row or delete the newly added row. After-sales service line response, the other party said that he did not test the problem. I'm dizzy. I used an installation disk from yonyou. sp1 was also downloaded from the official website. It's different from the one on his side !!!

I don't know when he will solve the problem. I can only do it on his own. Ah, happiness depends on his own hands ~~

Cause:
When you open an existing document, the system uses the client Javascript script to reproduce the document. One of the processes is to generate a repetitive table (professionally speaking, the slave table of the master table) (functions: init, initdetail ), in the initialization function, set the first row of the slave table to the current row, record it in the variable currentrow, and then call setabsolute (currentrow) the function displays the buoy "add or delete duplicate rows" next to the row.
When a row is added, it is inserted in the first line (another bug occurs, the old row keeps moving down, and the new row is inserted on the old row ).
When a row is deleted, the delrow function is called to delete the row. However, the delrow function checks whether the row is in the first row. If yes, deletion is not allowed (it is estimated that the table must have data). What is the result, all old rows cannot be deleted.

Solution:
To solve the problem, we need to correct the currentrow value. The method I used is to monitor the click event from the table, determine which row of the table falls on, and set it to the current row. There is also a problem. If you wrap a line through the keyboard, the currentrow value will not change. However, it is unrealistic for Web applications like Oa to operate without a mouse.

Modified file:
Common/JS/form. js under the OA directory

Modification content:
Add the following functions at the beginning of the file:

/*************************************** **************************************** *****************
When modifying a document, the "delete/Add duplicate rows" buoy is displayed on the first line by default, so that subsequent content cannot be deleted.
Add this function to dynamically adjust the position of the buoy and currentrow In the Click Event of the table control to ensure that the data can be deleted at will (the delrow function does not allow deletion when only one row is left)
This function sets the response to the onclick event of the detail table in the initdetail function.
Peng Guohui 2008-01-11
**************************************** **************************************** *****************/
Function _ setcurrow ()
{
VaR OBJ = Window. event. srcelement;
While (OBJ & obj. tagname! = "TR" & obj. tagname! = "Table" & obj. tagname! = "Body ")
{
OBJ = obj. parentnode;
}
If (OBJ & obj. tagname = "TR ")
{
/* Var TB = obj. parentnode;
While (Tb & TB. tagname! = "Table ")
TB = Tb. parentnode;
Alert (Tb. Name );
If (Tb. Name = "detail ")
{*/
Currentrow = OBJ;
Setabsolute (currentrow );
//}
}
}

Find the initdetail function (two) and add the following code at the beginning of the function:

// Set the onclick event of the detail table and dynamically call _ setcurrow to adjust the position of the "delete/Add duplicate rows" Buoy
// Peng Guohui 2008-01-11
VaR _ tb_detail = Document. getelementbyid ('detail ');
If (_ tb_detail)
_ Tb_detail.onclick = _ setcurrow;

OK, close!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.