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.
Syncfusion Feedback

Knockout custom binding

Thread ID:

Created:

Updated:

Platform:

Replies:

110128 Jul 19,2013 02:21 PM UTC Jul 20,2013 12:23 PM UTC JavaScript 2
loading
Tags: General
Mirko Pozzetti
Asked On July 19, 2013 02:21 PM UTC

Hi,
I try to create a knockout custom binding for ejGrid.
The data are plumbed into the code only for testing purposes (I reused those on your example).
When I run the code I have this error: Cannot call method 'helpers' of undefined
This is the code I used from one of yours example:

ko.bindingHandlers.ejgrid = {
    init: function (element, valueAccessor, allBindingsAccessor) {
        var data = [{ "OrderID": 10248, "CustomerID": "VINET", "EmployeeID": 5, "OrderDate": new Date(836418600000), "ShipName": "Vins et alcools Chevalier", "ShipCity": "Reims", "ShipAddress": "59 rue de l\u0027Abbaye", "ShipRegion": null, "ShipPostalCode": "51100", "ShipCountry": "France", "Freight": 32.3800, "Verified": true }];

        $(element).ejGrid({
            dataSource: data,
            columns: [
                        { field: "OrderID", headerText: "Order ID", key: true, textAlign: ej.textAlign.Right, width: 75 },
                        { field: "CustomerID", headerText: "Customer ID", width: 80 },
                        { field: "EmployeeID", headerText: "Employee ID", textAlign: ej.textAlign.Right, width: 75 },
                        { field: "Freight", headerText: "Freight", textAlign: ej.textAlign.Right, width: 75, format: "{0:C}" },
                        { field: "OrderDate", headerText: "Order Date", width: 80, textAlign: ej.textAlign.Right, format: "{0:MM/dd/yyyy}" },
                        { field: "ShipCity", headerText: "Ship City", width: 110 }
            ]
        });
    }
}

Thank you,
Mirko

Bharath M [Syncfusion]
Replied On July 20, 2013 12:18 PM UTC

Hi Mirko,

Thank you for your interest in Syncfusion.

To resolve this exception please add reference to "jsrender.js" in page. The following are dependencies of ejGrid.

1. jQuery
2. jsrender
3. jQuery easing

Let me know if you have any concerns.

Regards,
Bharath

Bharath M [Syncfusion]
Replied On July 20, 2013 12:23 PM UTC

Hi Mirko,

Sorry for the inconvenience.
 
I missed one more dependency i.e., jQuery.Globalize


Regards,
Bharath

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.

Warning Icon 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.Close Icon

;