or
grid.columns = [];
binders.widget = {
events : Binder.extend({
init:
function
(widget, bindings, options) {
Binder.fn.init.call(
this
, widget.element[0], bindings, options);
this
.widget = widget;
this
.handlers = {};
},
refresh:
function
(key) {
var
binding =
this
.bindings.events[key],
handler =
this
.handlers[key];
if
(handler) {
this
.widget.unbind(key, handler);
}
handler = binding.get();
this
.handlers[key] =
function
(e) {
// >> ISSUE: This line here is overwriting the row data with an instance to the binding source of the grid.
e.data = binding.source;
handler(e);
if
(e.data === binding.source) {
delete
e.data;
}
};
this
.widget.bind(key,
this
.handlers[key]);
},
destroy:
function
() {
var
handler;
for
(handler
in
this
.handlers) {
this
.widget.unbind(handler,
this
.handlers[handler]);
}
}
}),
$request
= json_decode(
file_get_contents
(
'php://input'
));
$result
=
new
DataSourceResult(
$dsn
,
$username
,
$password
,
$driver_options
);
$table
=
'users'
;
$columns
=
array
(
'id'
,
'name'
);
// Add the mandatory "enabled = 1" filter here
$data
=
$result
->read(
$table
,
$columns
,
$request
);
//Crosstab
kcSchoolCrosstab = $(
"#SchoolCrosstab"
).kendoChart({
title: {
text:
"Crosstab"
,
font:
"bold 16px Arial,Helvetica,Sans-Serif"
},
legend: {
visible:
false
},
dataSource: {
transport: {
read:
function
(options) {
if
(!(ktvSchoolFilter && ktvSchoolFilter.getSelectedSchoolCodes() && getSelectedSchoolYear())) {
options.success([]);
return
;
}
kendo.ui.progress(kcSchoolCrosstab.element,
true
);
$.getJSON(Helpers.toServicesUrl(
"/GetEWSSchoolCountVsRiskScore"
),
{
username: WSIPCContext.UserName,
districtId: WSIPCContext.DistrictId,
schoolCodes: ktvSchoolFilter.getSelectedSchoolCodes(),
schoolYear: getSelectedSchoolYear,
// countOfEvents: 3,
countOfEvents: getRiskCatCount(),
whereIds:
"1"
}).success(
function
(data) {
options.success([]);
kcSchoolCrosstab.dataSource.data(data.GetEWSSchoolCountVsRiskScoreResult.RootResults);
}).always(
function
() {
kendo.ui.progress(kcSchoolCrosstab.element,
false
);
});
},
group: {
field:
"GradeLevel"
},
sort: {
field:
"StudentCount"
}
}
},
series: [{
type:
"scatter"
,
xField:
"StudentRiskFactor"
,
yField:
'StudentCount'
,
color:
"#4F82BE"
,
name:
"#= group.value"
}],
legend: {
position:
"bottom"
},
xAxis: {
labels: {
step: 2,
format:
"{0}%"
},
title: {
text:
"Avg. School Risk Score"
}
},
yAxis: {
labels: {
skip: 2,
step: 2
},
title: {
text:
"Avg. School Count"
,
margin: {
right: 10
}
}
},
chartArea: {
height: 300,
width: 520
}
}).data(
"kendoChart"
)