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

[Solved] Grid popup editor using template

4 Answers 1158 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Robert
Top achievements
Rank 1
Robert asked on 15 Oct 2014, 07:04 PM

I'm trying to get a popup editor working using my own template. I can get the bindings to work programmatically from the edit event of the grid:

edit: function (e) {
    $('#numrkText').kendoNumericTextBox({
        value: e.model.Qty,
        format: "{0:n0}"
    });
    $('#divInitiator').kendoDropDownList({
        dataSource: theSysUsers,
        dataValueField: 'value',
        dataTextField: 'text',
        value: e.model.InitiatorID.toString()
    });
}

But I can't get declarative binding to work: (which is what I want)
<td class="tdLefts"><input type="text" name="Qty" data-type="number" data-bind="value:Qty" data-role="numerictextbox" /></td>

I get the same kind of error trying to bind the dropdownlist, I always end up at the maddeningly useless error showing you an anonymous function.

The Grid is not MVVM bound, My goal is to get the editor to be MVVM, though the grid is passed a json object array from a server ajax response.

Thanks, Bob

4 Answers, 1 is accepted

Sort by
0
Accepted
Vladimir Iliev
Telerik team
answered on 17 Oct 2014, 11:44 AM
Hi Riobert,

Please check the example below which demonstrates how you can use MVVM to initialize the widgets inside the Grid PopUp template:

Regards,
Vladimir Iliev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Andrea
Top achievements
Rank 1
answered on 19 Feb 2015, 10:34 PM
I would like to do something similar with a custom popup editor that has dropdowns that are bound back to the grid. This example doesn't seem to work though. 
0
Robert
Top achievements
Rank 1
answered on 19 Feb 2015, 10:53 PM
I'm sorry, this was too long ago for me to remember what solution I ended on (and without enough time to research it).

The example Vladimir proposed works for me in  the dojo.telerik, I'd start from there.

Bob
0
Andrea
Top achievements
Rank 1
answered on 19 Feb 2015, 11:04 PM
I found another similar example that does work for me. I'm not sure why this one doesn't. Thanks for the quick reply.
Tags
Grid
Asked by
Robert
Top achievements
Rank 1
Answers by
Vladimir Iliev
Telerik team
Andrea
Top achievements
Rank 1
Robert
Top achievements
Rank 1
Share this question
or