We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Using CheckBox with TypeScript & KnockoutJS

Thread ID:

Created:

Updated:

Platform:

Replies:

128320 Jan 13,2017 09:56 AM Jan 16,2017 06:37 AM JavaScript 1
loading
Tags: ejCheckBox
Gareth Brown
Asked On January 13, 2017 09:56 AM

I seem to be having trouble syncing a ejCheckBox with KnockoutJS to my view model.

<input
    type="checkbox"
    id="canEditCheckBox"
    data-bind="checked: myView().canEdit()" />

The following code by itself works fine. However when I create a ej.CheckBox in code it no longer binds to the check data

this.canEditCheckBox = new ej.CheckBox($("#canEditCheckBox"), {
    size: "medium",
    enableTriState: false,
    enabled: true
});

I've also tried to bind set the check value within the ej.CheckBox but it does not work either, i.e. is not updated.

Also I've changed the HTML binding but again it doesn't work.

<input
    type="checkbox"
    id="canEditCheckBox"
    data-bind="ejCheckBox: {checked: myView().canEdit()}" />

Is this entirely possible? I've looked through JavaScript & TypeScript demo and can't see anything to help.

Prem Kumar Madhan Raj [Syncfusion]
Replied On January 16, 2017 06:37 AM

Hi Garet,   
   
Thank you for contacting Syncfusion support,   
   
We have checked your requirement for binding ViewModel data with Checkbox and was unable to reproduce the reported issue.    
   
We have created a simple sample based on your requirement.    
   
If this is not the scenario you are trying to achieve, then please let us know with the edited sample to replicate the reported issue, so, that we could find a solution.   
   
Regards,   
Prem Kumar Madhan Raj.   


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;