0
votes

I am trying to implement the popup editor for kendo ui grid with angularjs. Edit of my record works just fine but Adding a new record seems to be sending data-value-field as [object Object]. I just can't seem to figure that out.

Here is my data source in controller:

$scope.tempDataSource = '[{"value": 7,"text": "fdsdd - dsfdsfdsf"},{"value": 6,"text": "sads - sadsa"},{"value": 5,"text": "dsf - dsfdsf"},{"value": 2,"text": "dsf - sdfdsfds"}]';

and here is my dropdown list:

<input name="AppName"
                   data-bind="value:projId"
                   data-value-field="value"
                   data-text-field="text"
                   data-source="{{tempDataSource}}"
                   data-role="dropdownlist" />

As I mentioned, Grid record edit works just fine. It is an add record which sends value as [object Object]

1
can you add your add record function please - NTP

1 Answers

0
votes

Why are you passing string? Can you try it like this:

$scope.tempDataSource = [{"value": 7,"text": "fdsdd - dsfdsfdsf"},{"value": 6,"text": "sads - sadsa"},{"value": 5,"text": "dsf - dsfdsf"},{"value": 2,"text": "dsf - sdfdsfds"}];

and in html:

<input name="AppName"
                   data-bind="value:projId"
                   data-value-field="value"
                   data-text-field="text"
                   data-source="tempDataSource"
                   data-role="dropdownlist" />