Hi,
I have an editable grid showing data from DataSource and updating the backend with autosync. So far everything has gone quite smoothly and I'm generally pleased with Kendo grid filtering capabilities. I, however, have an issue with autosync. I want to disable some columns from autosync.
The simplified model of the grid is two columns, “word1” and “word2”. In addition to that, I will have several boolean columns that I use for filtering. I have several such boolean columns. Some of them are generated on the backend and some of them I want to modify on-the-fly in client.
One such filter is to flag rows that have the same value in columns “word1” and “word2”.
I have tested iterating over data and setting the boolean column. The current test code is as follows:
When I run the function, it updates the column as I want it to. But, here's the issue; it
sometimes generates a lot of traffic for the backend because many values in the boolean column might change. This is not wanted, since the boolean columns are only temporary for the user to get a glance at the data. Autosync should only track columns word1 and word2. The changes in other columns should go unnoticed by autosync.
Finally, my two questions:
1) Is there a way to define which fields are monitored by autosync?
2) Is there a way to define which fields are sent to backend after editing? I do not need the contents of temporary boolean columns on the backend, so when user changes, say, word1, I am only interested in getting values of word1 and word2, not the other columns.
I have an editable grid showing data from DataSource and updating the backend with autosync. So far everything has gone quite smoothly and I'm generally pleased with Kendo grid filtering capabilities. I, however, have an issue with autosync. I want to disable some columns from autosync.
The simplified model of the grid is two columns, “word1” and “word2”. In addition to that, I will have several boolean columns that I use for filtering. I have several such boolean columns. Some of them are generated on the backend and some of them I want to modify on-the-fly in client.
One such filter is to flag rows that have the same value in columns “word1” and “word2”.
I have tested iterating over data and setting the boolean column. The current test code is as follows:
01.
$(
"#test"
).click(
function
() {
02.
for
(
var
i=0; i<DS.data().length; i++) {
03.
var
row = DS.at(i);
04.
if
(row.word1==row.word2) {
05.
console.log(
"Words are the same: "
+row.word1+
"=="
+row.word2)
06.
row.set(
"ok"
,
true
);
07.
}
else
{
08.
console.log(
"Words are not the same: "
+row.word1+
"!="
+row.word2)
09.
row.set(
"ok"
,
false
);
10.
}
11.
}
12.
});
sometimes generates a lot of traffic for the backend because many values in the boolean column might change. This is not wanted, since the boolean columns are only temporary for the user to get a glance at the data. Autosync should only track columns word1 and word2. The changes in other columns should go unnoticed by autosync.
Finally, my two questions:
1) Is there a way to define which fields are monitored by autosync?
2) Is there a way to define which fields are sent to backend after editing? I do not need the contents of temporary boolean columns on the backend, so when user changes, say, word1, I am only interested in getting values of word1 and word2, not the other columns.