This is a migrated thread and some comments may be shown as answers.

mvvm: linefeed in textarea

2 Answers 56 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Juergen
Top achievements
Rank 1
Juergen asked on 03 Nov 2015, 03:19 PM

Hi,

i need help.

I have a dynamically created website with a textarea ...

<textarea id="input_551_702_O2050_702" data-bind="value: values.input_551_702_O2050_702.current" class="k-textbox" style="height: 114px; width: 300px;"></textarea>

 

and a viewmodel.

I try to bind a value

"Praxis\r\nDr. Eugen Knollmüller\r\nDr. Eugen Knollmüller jun.\r\nDr. Sandra Knollmüller"

which works.

How do i get linefeeds in my textarea.

I tried <br\>, \n, \r\n .... but the textarea always show the correct value ... but no linefeeds.

the hole viewmodel is also dynamically generated.

.....

$(function () {
...

   lecore.page_510.viewModel = kendo.observable({
        values: { 
         .....
               input_551_702_O2050_702: {
                       initial: 'Praxis\\r\\nDr. Eugen Knollmüller\\r\\nDr. Eugen Knollmüller jun.\\r\\nDr. Sandra Knollmüller',
                       current: 'Praxis\\r\\nDr. Eugen Knollmüller\\r\\nDr. Eugen Knollmüller jun.\\r\\nDr. Sandra Knollmüller',
                       refObject: 'O2050'
            }
         ....
...

Regards

 

Jürgen

2 Answers, 1 is accepted

Sort by
0
Accepted
Alexander Popov
Telerik team
answered on 05 Nov 2015, 11:33 AM
Hi Jürgen,

I tried reproducing this here, but both the text and the value bindings seem to work as expected. Let me know if I am missing something.

Regards,
Alexander Popov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Juergen
Top achievements
Rank 1
answered on 05 Nov 2015, 12:25 PM

Hi Alexander,

meanwhile i found my Problem (it exits between keyboard and chair ;-))

It works like shown in dojo.

Thanks

Regards

Jürgen

 

Tags
General Discussions
Asked by
Juergen
Top achievements
Rank 1
Answers by
Alexander Popov
Telerik team
Juergen
Top achievements
Rank 1
Share this question
or