This is a migrated thread and some comments may be shown as answers.

Custom editor with Angular JS - element compiled twice

1 Answer 16 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Nolte
Top achievements
Rank 1
Nolte asked on 17 Jul 2015, 02:33 PM

It seems the Angular howto: "Custom editor with Angular JS" is out-dated?

From the howto...

$scope.categoryDropDownEditor = function(container, options) {
    var editor = $('<input kendo-drop-down-list required k-data-text-field="\'CategoryName\'" k-data-value-field="\'CategoryID\'" k-data-source="ddlDataSource" data-bind="value:' + options.field + '"/>')
        .appendTo(container);
 
    $compile(editor)($scope);
    editor.css("visibility", "visible");
}

The function creating the cell editor does a $compile on the custom element "editor". However when I follow this approach I noticed that in my own code the link functions in my directives on the custom element execute twice. Upon investigation it seems that since Kendo compiles the TD containing my custom element, my custom ‚Äčelement will automatically get compiled so doing a compile within the custom cell editor function is not correct?

 

1 Answer, 1 is accepted

Sort by
0
Kiril Nikolov
Telerik team
answered on 21 Jul 2015, 10:18 AM
Hello Nolte,

You are right that since the latest release it is not needed to compile the directive again. I will update the example. Thanks for bringing this up.

Regards,
Kiril Nikolov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Grid
Asked by
Nolte
Top achievements
Rank 1
Answers by
Kiril Nikolov
Telerik team
Share this question
or