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

Grid column binding with custom editor

0 Answers 171 Views
MVVM
This is a migrated thread and some comments may be shown as answers.
Roland
Top achievements
Rank 1
Roland asked on 02 Oct 2012, 08:55 AM
How can i bind a custom editor to my grid
<div id="grid" data-role="grid" data-bind="source: gridDataSource" data-editable="inline" data-columns='[
        { "command": ["edit", "destroy"], "title": " ", "width": "120px" },
        { "field": "title", "width": "100px", "editor": "titleEditor"},
        { "field": "year", "width": "100px" }
    ]'>
     
</div>
I want that the titleEditor will be shown
function titleEditor(container, options) {
    var inputField = $('<input data-text-field="title" data-value-field="title" data-bind="value:' + options.field + '"/>');
    var button = $('<span unselectable="on" class="k-icon k-i-search">select</span>');
    button.click(function(e) {
        lookupdialog.dialog({
             
        });
    });
    inputField.after(button);       
    inputField.appendTo(container);
};

See my jsfiddle

Thanks

No answers yet. Maybe you can help?

Tags
MVVM
Asked by
Roland
Top achievements
Rank 1
Share this question
or