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. Image for the cookie policy date

Knockout custom binding

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

2 Replies

BM Bharath M Syncfusion Team 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


BM Bharath M Syncfusion Team July 20, 2013 12:23 PM UTC

Hi Mirko,

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


Regards,
Bharath

Loader.
Live Chat Icon For mobile
Up arrow icon