I am not sure how your implementation goes since you did not share any code. However here is an example that I created from your explanation.
It is working correctly on my side. I hope it helps.
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI