Thursday, April 9, 2015

Kendo if (ko if) vs data-bind if

It's very small thing but it may be the point of ignorance somewhere.  Sometime we don't consider some small points during implementation. And here it is :

If we have requirement to draw controls/table rows based on any condition then we should use  <!-- ko if : <condition> --> instead of data-bind="if: <condition> ".

Because data-bind="if: <condition>" doesn't restrict to creates the control/table row in actual but only controls the behaviour visible show/hide.  While the  <!-- ko if : <condition> -->  restricts the program to create control/row until condition satisfied.

It’s just an information and could be considered during implementation based on your requirement. 

No comments: