Declined
Last Updated: 06 Sep 2013 16:52 by ADMIN
Matt
Created on: 04 Sep 2013 08:45
Category: Kendo UI for jQuery
Type: Feature Request
1
Fix bug regarding Source binding to non-array value and wrapping visible conditional
Given a object such as Person which has an optional child object such as IdentityDetails (1:0/1) I cant get this to work properly. I just dont want to show the template if identitysection is null. 

Even when hasIdentitySection returns false this produces an exception because it tries to evaluate identitySection which is null

<div data-bind="visible: hasIdentitySection">           
 <div data-bind="source: identitySection" data-template="identity-template"></div> </div> 
3 comments
ADMIN
Brandon
Posted on: 06 Sep 2013 16:52
Please report this potential bug via the kendo UI forums or by creating a ticket in your account.
Matt
Posted on: 04 Sep 2013 10:41
So the solution, is to simply treat null as [], this makes handling non-array values with data-template almost pleasant.  Cant see any side effects to adding this fix to core 
Matt
Posted on: 04 Sep 2013 08:50
I guess one can workaround it by having source: getIdentitySection which basically does this.get("identitySection") || [] but it kinda sucks