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

Grid popup edit template bind does not work properly

1 Answer 111 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Amir
Top achievements
Rank 1
Amir asked on 05 Feb 2013, 10:20 AM
Hello all! thank for this great product.
I use a grid with popup editor for insert and edit grid rows.
in template I use radio button group 

<script type="text/x-kendo-template" id="popup_editor">
    <input id="4" type="radio"  name="Condition" checked=true data-bind="NRDisabled : ChequeNotPassedChange" />
    <input id="5" type="radio"  name="Condition" data-bind="NRDisabled : ChequeReturnedChange" />
    <input id="8" type="radio" name="Condition"  data-bind="NRDisabled : ChequeNaghdiChange" />
</script>
and the properties defined in viewmodel
var viewModel = kendo.observable({
            ChequeNaghdiChange:false,
             ChequeReturnedChange:false
........


the NRDisabled  is used for disable and enable control and its work perfectly out of popup by simple set true or false property 
viewModel.set("ChequeNaghdiChange",false);
 kendo.data.binders.NRDisabled = kendo.data.Binder.extend({

        refresh: function () {
            if (this.bindings.NRDisabled.get()) {
                this.element.setAttribute("disabled", "disabled");
            } else {
                this.element.removeAttribute("disabled");
            }
        }
    });

It's seems property binding have some problem in kendo.
Best Regards
Amir

1 Answer, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 07 Feb 2013, 09:01 AM
Hello Amir,

The popup editor is bound to the item for the row so the value returned by the "NRDisabled" binding will always be false. The values should either be included in the Grid items or you should get the value from the observable array parent in order to set the attributes correctly.

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