0
votes

I have a kendo grid which uses row template. The template contain combo box , Auto complete ... Grid also has icons with click event .

Issue :When selecting values from combo box / icon click or any change we are updating the values of grid data source and calling grid.refresh(). Which refresh the entire grid.

At this point it is re binding the data source of all controls which is fetched inside transport read function.

Is there any way to prevent this. or on preventing it will it cause problem in refreshing the grid with updated data. Please find code below.

validAttributeDataSource = new kendo.data.DataSource({
                                serverFiltering: true,
                                serverPaging: true,
                                pageSize: 20,
                                type: "json",
                                transport: {
                                    read: function (options) {
                                        if (rowObj.IsLoad || isBrowserIE) {

                                            ComboboxReadForAttributeAndValidValues(rowObj, "GetAttributeValidValuesAndAttributesContains", options, row.AttributeId, attributeNm, operatorId);
                                            rowObj.IsLoad = false;
                                        }
                                        else {
                                            options.success(rowObj.OldValues);
                                        }
                                    }
                                }
                            });

Sample code for updating data source

var gridObj = $('#Grid.k-grid').data("kendoGrid");
var selectedRow = $(event.currentTarget).closest("tr");
var dataItem = gridObj.dataItem(selectedRow);
dataItem.CrudType = CruddTypeDelete;
gridObj.refresh();

thanks in advance

1
Can you put this in a jsfiddle or kendo dojo ? No? Can you show the template ? How about the code for updating the data source ? Are you using sync() ? Is the grid batch mode ? Why do you feel you need to refresh() ?Richard
I am using gridObj.refresh(). After updating the data source values, the changes are not reflecting in the grid with out refresh. I have added the code for updating data source above. The grid is not in batch mode.NishanthMV
Can you show the grid instantiation code and the row template ?Richard

1 Answers

0
votes

Try using the .SET() method instead of direct assignment.

dataItem.set('CrudType', CruddTypeDelete);