I've found a minor bug in the listbox client-side function findItemByValue. If you pass it an INTEGER with the value zero, it always returns null. Passing it any other integer (where an item with that value exists) will work correctly. The cause of the problem is that the function findItemByValue is coded as:
When g is an integer 0, !g is true, so the function returns null. (When g is an integer 1, !g is false, when g is a string "0", !g is false.)
The work-around is simple, just don't pass an integer, but to work correctly and consistently, the function should check for "undefined" or null or "" instead of using !g, or it should check the type of the value passed first.
Since findItemByValue actually works correctly when a non-zero integer is passed, it took me a little work to figure out what the problem was. Hopefully this post will help others avoid the problem (I haven't checked, but I'd bet that the same problem occurs in other Telerik controls as well).
function
(g){
if
(!g){
return
null
;}...
When g is an integer 0, !g is true, so the function returns null. (When g is an integer 1, !g is false, when g is a string "0", !g is false.)
The work-around is simple, just don't pass an integer, but to work correctly and consistently, the function should check for "undefined" or null or "" instead of using !g, or it should check the type of the value passed first.
Since findItemByValue actually works correctly when a non-zero integer is passed, it took me a little work to figure out what the problem was. Hopefully this post will help others avoid the problem (I haven't checked, but I'd bet that the same problem occurs in other Telerik controls as well).