I've use the following code to put an additional data into dataSource
var
dataSource =
new
kendo.data.DataSource({
autoSync:
false
,
transport: {
read:
function
(options) {
$.ajax({
url: get_data.url(),
dataType:
"json"
,
success:
function
(result) {
options.success(result);
},
error:
function
(result) {
options.error(result);
}
});
},
update: pushData(
"update"
), create: pushData(
"create"
),
},
batch:
true
,
"schema"
: {
data:
"row"
,
total:
"total"
,
rowsdata:
"rowsdata"
,
model: modelConfig
},
group: groupConfig,
aggregate: aggConfig,
sort: sortConfig
});
and than I used this data
...
...
var
HideParams =
function
(obj) {
var
g = obj.sender;
var
hd = undefined;
if
(g && g.dataSource && g.dataSource._pristine && g.dataSource._pristine.rowsdata) hd = g.dataSource._pristine.rowsdata;
if
(hd) {
for
(
var
i = 0; i < hd.length; i++) {
if
(hd[i] && hd[i].hidden) g.hideColumn(hd[i].name);
}
}
};
...
...
...
var
gridConfig = {
dataSource: dataSource,
...
...
...
dataBound:
function
(e) {
if
(
typeof
extDataBound ===
"function"
) extDataBound(e);
if
(
typeof
GridLocate ===
"function"
) GridLocate(e);
if
(
typeof
HideGrouped ===
"function"
) HideGrouped(e);
if
(
typeof
HideParams ===
"function"
) HideParams(e);
},
...
...
...
};
$(
"#grid"
).kendoGrid(gridConfig);
But now g.dataSource._pristine is undefined
How I can access rowsdata object in dataSource ?