1

我添加了一个按钮来将弹出页面中的值返回到 RTF 字段。但我目前的要求是将值添加到简单的文本字段中。谁能给我建议一种方法,如何将值返回到简单的文本字段?

4

1 回答 1

4

Currently you can't do that in supported way because there are no API to get access to Field Builder control from the View. If you'll decide to workaround this (accessing private properties, some other hacks), you can achieve this by using Field Builder control API. For example:

var field = fieldBuilder.getFocusField(); // returns currently focused field object
field.getValues();  // returns field values (might be more than 1 in case of multivalue fields
field.setValues([...]); // sets field values

But be careful, that by clicking on the Ribbon Toolbar Button focus will be moved out from the field to the Ribbon Toolbar Button. So fieldBuilder.getFocusField() will return null. One of the possible solutions to listen for the "focusmove" event on Field Builder control to track focused fields.

于 2012-04-25T12:34:09.323 回答