mardi 14 novembre 2017

Checkbox checked binding not working in kendo template

Here is the situation.

I'm working in a Kendo template for the editing my form fields.I have a model with a integer field called "Sale_Exclude".The form field associated with "Sale_Exclude" is a check box. This is how i have the values bind right now.

<script type="text/x-kendo-template">
  <div class="form-group col-sm-1 checkboxField">
                <label class="checkbox-inline">
                   <input type="checkbox" id="excludecheck" data-bind="checked: Sale_Exclude == 1 ? true : false" >
                    Exclude
                </label>
            </div>

But this is giving me error on changing the value of the checkbox

Uncaught ReferenceError: Invalid left-hand side in assignment

I have checked im getting correct value in the "Sale_Exclude" field (i.e 0). The checkbox binding is working fine the error occurs only when i change the checkbox value.




Aucun commentaire:

Enregistrer un commentaire