1

父表格是相同的,我只在请求中更改公司,在某些公司我得到父表格而不是子表格。因此,例如,我有默认公司请求获取一些表格。根据用户操作,我在表单请求中更改了公司(但它是相同的表单名称)。

之后,我尝试获取一些子表单,并在一个特定的公司/表单上获取父子表单而不是子表单。

我已经阅读了有关看起来相同的问题的主题,但是获取行并设置活动行对我没有帮助。有人有这个问题吗?

async getDocuments(formName: string, getMappedRows: Function) {
        const _currentOrderType = this.priorityService.getCurrentOrderType();
        const _groupForm        = await this.priorityService.getFormBridge(eSharedForm.GROUP.toString());
        await _groupForm.setActiveRow(_currentOrderType.company.key);
        const ListForm = await this.priorityService.getSubFormBridge(formName.toString(), _groupForm);
//some more logic 
}

private async _getSubForm(name: string, form: any) {
            try {
                const subform = await form.startSubForm(name, this.onMessage, this.onUpdate);
                debugger;
                return subform;
            } catch (e) {
                this.subForms[name] = undefined;
                const _e = JSON.stringify(e);
                console.log(`[PriorityService::_getSubForm] Error starting subform '${name}': ${_e}`);
                throw e;
            }
        }

之后我看到和以前一样的表格

4

1 回答 1

1

从您的代码片段中不清楚Is it numericgetSubFormBridge的作用或值是什么?_currentOrderType.company.key这是您要检索的行号吗?

启动 Parent 窗体时,尝试设置autoRetrieveFirstRows为 1,即选择当前窗体的第一行。如果您确定要检索哪一行,请传递正确的行号。

例如: const form = await priority.formStart('ORDERS', this.onError, this.onSuccess, '', 1);

如果您需要先过滤然后选择一行,请使用setActiveRow方法并将您要检索的行号传递给它。(从 1 开始)

选择行后,检索子表单。例如:

const subform = await form.startSubForm("ORDERITEMS");
于 2018-10-18T18:34:41.850 回答