H3BPM sub-table replication and H3BPM sub-table replication
During a process, the following table data is directly obtained from the table and is not editable. There is no button to add or delete rows. The ComputationRule attribute is used at the beginning, but one item is the date space. Without this attribute, I don't know how to handle it. The following is an example of how to handle it in the official forum:
In a form, the control type is a sub-Table data item. The front-end code of the control is actually the method for traversing the sub-Table below the Table to retrieve and assign values to the sub-Table cyclically: // The function of this method is to copy the subtable TravelExpensesList to the subtable FinancialAudit. // step Resolution: // 1. Obtain the total number of rows of the subtable FinancialAudit // 2. Because the subtable TravelExpensesList is copied to the subtable FinancialAudit, that is, the subtable TravelExpensesList has a value, the subtable schemalaudit is just initialized and has no value. Therefore, before synchronizing values, you must ensure that the rows of the two subtables are consistent, therefore, each cycle needs to compare whether the number of rows is consistent. // 3. Obtain the data values of the columns of the subtable TravelExpensesList through the row number, and assign the values to the subtable FinancialAuditfunction InitFinancialAuditData () {// obtain the total number of rows of FinancialAudit (J Query) var export alauditlength = $ ("table [data-datafield = 'your alaudit ']"). find ("tr. rows "). length; // because FinancialAudit synchronizes data to TravelExpensesList, it starts to traverse the subtable TravelExpensesList, get the value of each row and assign the value to the corresponding row of the subtable paialaudit $ ("table [data-datafield = 'travelexpenseslist']"). find ("tr. rows "). each (function () {// obtain the row number of the row currently traversed by the subtable TravelExpensesList. // Note: A subtable is a table, each tr and td in the table has a "data-row" attribute, which records the row number of the current tr and td (that is, the order before each row ). () Var row = $ (this ). attr ("data-row"); // compare whether the current row number is greater than the total number of rows in the FinancialAudit sub-table. If the value is greater than that, add a row in FinancialAudit for synchronization, otherwise, even if the data of the two sub-tables is synchronized, the initialized alaudit row is the first row, cause all data in rows 2nd and 2nd to be invisible // Of course, the method of adding rows cyclically in this part can be optimized again, or if (row> FinancialAuditLength) is completed out of loop) {// H3 Method for adding rows to the sub-table, which is an H3-encapsulated method $ ("# Control23 "). sheetUIManager (). _ AddRow ();} // synchronize the data of the two tables // method $. mvcSheetUI. setControlValue ("parameter 1", "parameter 2", parameter 3); is used to assign values to sub-tables, for sub-table data; yes $. mvcSheetUI. SetControlValue ("parameter 4", parameter 5); while $. mvcSheetUI. setControlValue ("parameter 4", parameter 5); For form data // $. mvcSheetUI. setControlValue ("parameter 1", "parameter 2", parameter 3); parameter description: // parameter 1: data item encoding corresponding to the data item in the sub-table you want to assign a value // parameter 2: the value you want to assign a value to the data item // parameter 3: Sub-table row number // function description: find the corresponding sub-table data item based on the row number and encoding (similar to the horizontal and vertical coordinates) You provide and assign a value // method $. mvcSheetUI. getControlValue ("parameter 1", parameter 2); is to take the sub-Table value, for the sub-table data; is $. mvcSheetUI. getControlValue ("parameter 4"); and $. mvcSheetUI. setControlValue ("parameter 4"); For form data // $. mvcSheetUI. S EtControlValue ("parameter 1", parameter 2); parameter description: // parameter 1: data item encoding corresponding to the data item in the child table to be assigned a value // parameter 2: sub-table row number // Function Description: Find the corresponding sub-table data item based on the row number and code you provide (similar to the horizontal and vertical coordinates) $. mvcSheetUI. setControlValue ("FinancialAudit. hyperlink ", $. mvcSheetUI. getControlValue ("TravelExpensesList. hyperlink ", row), row); $. mvcSheetUI. setControlValue ("FinancialAudit. startPlace ", $. mvcSheetUI. getControlValue ("TravelExpensesList. startPlace ", row), row); $. mvcSheetUI. setControlValu E ("FinancialAudit. startDate ", $. mvcSheetUI. getControlValue ("TravelExpensesList. startDate ", row), row); $. mvcSheetUI. setControlValue ("FinancialAudit. destination ", $. mvcSheetUI. getControlValue ("TravelExpensesList. destination ", row), row); $. mvcSheetUI. setControlValue ("FinancialAudit. returnDate ", $. mvcSheetUI. getControlValue ("TravelExpensesList. returnDate ", row), row); $. mvcSheetUI. setControlValue ("F Inmo-alaudit. days ", $. mvcSheetUI. getControlValue ("TravelExpensesList. days ", row), row); $. mvcSheetUI. setControlValue ("FinancialAudit. customer ", $. mvcSheetUI. getControlValue ("TravelExpensesList. days ", row), row); $. mvcSheetUI. setControlValue ("FinancialAudit. cityType ", $. mvcSheetUI. getControlValue ("TravelExpensesList. cityType ", row), row); $. mvcSheetUI. setControlValue ("FinancialAudit. totalCost ", $. MvcSheetUI. getControlValue ("TravelExpensesList. totalCost ", row), row); $. mvcSheetUI. setControlValue ("FinancialAudit. attachmentNumber ", $. mvcSheetUI. getControlValue ("TravelExpensesList. attachmentNumber ", row), row); var val = $. mvcSheetUI. getControlValue ("FinancialAudit. checkMoney ", row); if (val! = Null & val! = "") {} Else {$. mvcSheetUI. setControlValue ("FinancialAudit. checkMoney ", $. mvcSheetUI. getControlValue ("TravelExpensesList. totalCost ", row), row) ;}}); // JQuery method // locate the corresponding columns of FinancialAudit in the sub-table by encoding the sub-table data items, add an uneditable attribute to the entire column $ ("input [data-datafield = 'externalaudit. hyperlink'] "). attr ("disabled", "disabled"); $ ("input [data-datafield = 'externalaudit. startPlace '] "). attr ("disabled", "disabled"); $ ("input [data-datafield = 'externalaudit. startdate'] "). attr ("disabled", "disabled"); $ ("input [data-datafield = 'externalaudit. destination '] "). attr ("disabled", "disabled"); $ ("input [data-datafield = 'externalaudit. returndate'] "). attr ("disabled", "disabled"); $ ("input [data-datafield = 'externalaudit. days '] "). attr ("disabled", "disabled"); $ ("input [data-datafield = 'externalaudit. customer '] "). attr ("disabled", "disabled"); $ ("input [data-datafield = 'externalaudit. cityType '] "). attr ("disabled", "disabled"); $ ("input [data-datafield = 'externalaudit. totalCost '] "). attr ("disabled", "disabled"); // $ ("input [data-datafield = 'externalaudit. attachmentNumber '] "). attr ("disabled", "disabled");} This example only describes how to synchronize sub-tables. I hope you can learn more about sub-tables in this example, and flexible use of this example is also one of the many ways, I hope you do not limit it to this