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

MVVM & KendoUI widget's _old value.

8 Answers 102 Views
MVVM
This is a migrated thread and some comments may be shown as answers.
Ray
Top achievements
Rank 1
Ray asked on 07 Nov 2012, 01:49 AM
Hi 
I'm use mvvm model to bind kendo ui widget's value.
and i find if set kendo ui widget's value by mvvm model then widget's _old wasn't change.
so when input the same value again, then wasn't trigger widget's change and so mvvm model's value wasn't change too.
i create a jsfiddle to display this problem.
http://jsfiddle.net/ray521/4v57S/

8 Answers, 1 is accepted

Sort by
0
Unik
Top achievements
Rank 1
answered on 27 Dec 2012, 08:25 PM
Have problem with autocomplete too when we try to empty the value the onchange doesn't fire

http://jsfiddle.net/Z8yL8/52/

And sometime null appear in the text of the autocomplete
0
Atanas Korchev
Telerik team
answered on 28 Dec 2012, 04:33 PM
Hi,

 Please clarify what "onchange doesn't fire" mean. The linked jsfiddle demo does not contain code for handling any events. How can we reproduce the actual issue you are having using that code?

Greetings,
Atanas Korchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Unik
Top achievements
Rank 1
answered on 28 Dec 2012, 05:10 PM

the first probleme is when you start our code the autocomplete show the text "null".

then if you click initialize we set value in the model. the autocomplete then change is text.

but if we try to erase the text of the autocomplete and we click somewhere else the text of the autocomplete change but not the value of the model. the same comportement appear if you select a value from the list and you try to erase it after. but if you type text without selection any value and after you try to erase it's, the value of the model change to null but the autocomplete show the text null. is there something we are doing wrong ?

0
Atanas Korchev
Telerik team
answered on 02 Jan 2013, 08:46 AM
Hello,

 This problem occurs because of the way the select event is handled. First e.preventDefault() aborts the selection altogether. Then you update the value of the combobox using the "FirstName" field whereas dataTextField is set to "Description".

I updated the example so it works in a more predictable way: http://jsfiddle.net/Z8yL8/56/

Greetings,
Atanas Korchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Unik
Top achievements
Rank 1
answered on 02 Jan 2013, 03:24 PM

Thank you for the answer.

 but in your example i notice that at the very begining the autocomplete show the text "null" but, in our application we need the autocomplte to be show nothing at the begining. then in our application we are using two autocomplete one for the first name and the second for the last name, but each of the autocomplete are bind to the same list of person and need to display the description of each posible selection. when someone select a person from any of the two autocomplete we want the first name autocomplete to show the selected first name and the last name autocomplete to show the selected last name. this is the reason why we where preventing the normal way of selecting of the autocomplete. but is there a better way for achieving our goal ? I have update the fiddle to represent more the structure we are needing and the initialise boutton to show what we want to acheive when we select someone from any of the two autocomplete. http://jsfiddle.net/Z8yL8/57/

 thank you in advance.

0
Atanas Korchev
Telerik team
answered on 02 Jan 2013, 03:52 PM
Hi,

 Which browser are you testing in? When I check this example it never shows "null" at the beginning.

 You should use the Field you want the autocomplete to select when setting data-text-field. You can't use "Description" for that. Here is how things should work: http://jsfiddle.net/Z8yL8/59/

Regards,
Atanas Korchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Unik
Top achievements
Rank 1
answered on 02 Jan 2013, 04:12 PM
we are using ie8 and ie9 and the two of them have this behavior, but we have notice that in firefox and google chrome it dosen't shows "null".  Bug??

Thank you!

We will try to make our application work with the information you have provide us.
0
Atanas Korchev
Telerik team
answered on 03 Jan 2013, 08:36 AM
Hi,

 Indeed null is displayed in this particular case in Internet Explorer. I have logged this as a bug and we will fix it in a future release. As a workaround you can always set some default value for the autocomplete.

Greetings,
Atanas Korchev
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
Ray
Top achievements
Rank 1
Answers by
Unik
Top achievements
Rank 1
Atanas Korchev
Telerik team
Share this question
or