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

Model is not updated when text is inserted by mouse "paste". Bug?

3 Answers 135 Views
MVVM
This is a migrated thread and some comments may be shown as answers.
Volodymyr Oliinyk
Top achievements
Rank 1
Volodymyr Oliinyk asked on 22 Jan 2013, 08:52 PM
Hello,

When I use data-value-update="keyup" in input text element
model is not updated when I inserted text by mouse ("paste" operation).
Even when I click to "Save" button (focus is lost) model still has no value.

If I remove data-value-update="keyup" all starts working well.
This is very inconvenient because I need both these functions: "on key up" update and update on "paste" by mouse.

Can I use both these update events?

Vladimir

3 Answers, 1 is accepted

Sort by
0
Petur Subev
Telerik team
answered on 24 Jan 2013, 08:18 AM
Hello Volodymyr,

As the name of the data-value-update attribute describes the value is updated when a keyboard button is released. This means that the default update method data-value-update="change" is not active.

I am afraid that both ways working at once are not supported. If you like you can suggest an improvement to the MVVM framework feature on our Kendo User Voice page so it can support something like:

data-value-update="keyup change"


Regards,
Petur Subev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Volodymyr Oliinyk
Top achievements
Rank 1
answered on 24 Jan 2013, 08:29 AM
Is there a way to do a force update of the model from js code?
0
Petur Subev
Telerik team
answered on 28 Jan 2013, 08:37 AM
Hello Volodymyr,

You can attach custom handler to the keyup function and update the value of the viewModel manually with the set model method.
e.g.
$('#theInputSelector').on('keyup',function(e){
    viewModel.set('proName',$(this).val())
})


Kind Regards,
Petur Subev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
MVVM
Asked by
Volodymyr Oliinyk
Top achievements
Rank 1
Answers by
Petur Subev
Telerik team
Volodymyr Oliinyk
Top achievements
Rank 1
Share this question
or