discover
Starts the discover request with the specified options.
Parameters
options String
The options of the discover request.
Returns
Object
—The deferred object.
Example
<script>
var dataSource = new kendo.data.PivotDataSource({
columns: ["ProductName" ],
rows: ["Category"],
measures: ["Sum"],
data: [{ ProductName: "Chai", UnitPrice: 42, Cateogry: "Beverages" } ],
schema: {
cube: {
dimensions: {
ProductName: { caption: "All Products" },
Category: { caption: "All Cateogries" }
},
measures: {
"Average": {
field: "UnitPrice",
aggregate: function(value, state, context) {
if (!isNaN(value)) {
state.count = (state.count || 0) + 1;
return (state.accumulator || 0) + value;
} else {
return state.accumulator;
}
},
result: function(state) {
return state.accumulator / state.count;
}
}
}
}
}
});
dataSource.fetch(function() {
/* The result can be observed in the DevTools(F12) console of the browser. */
console.log(dataSource.data(), dataSource.axes());
});
</script>