質問

I have a property grid within which is currently a displayfield. I have been asked to make this particular field a multi-line field, so that text is wrapped around and carriage returns in the text are shown correctly.

I looked at a textareafield, but this seems to ignore readOnly: true, editable: false and methods of avoiding edits such as beforeedit: function(){return false;}.

I also tried to try and apply multiple line inserts (converting them to </br>) as part of the renderer within the displayfield , but this does not seem to work either.

What is the most efficient method of achieving this? Am I missing something simple in the API that provides the functionality I require?

I'd like to think this can be abstracted to a general case quite easily, but can provide code if deemed necessary.

EDIT:

To try and clarify my problem, I need a field that:

  1. Cannot be edited by the user; no text bar and typing in the field.

  2. Allows for multiple lines of text to be shown, by both word-wrap and by carriage returns/new lines

Think of a textareafield (expands to show all its contents) crossed with a displayfield (no editing capability).

役に立ちましたか?

解決

You might be looking for a textareafield with disabled set to true..
You can have new lines on the text with \n.

Hope that helps ! :)

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top