@model IEnumerable<WebSiteHotelRazor.Models.ReportesModeloVentas>
<h1>Reporte de Ventas Año 2011</h1>
<p>
@(Html.Kendo().Grid(Model)
.Name("GridAGQ")
.Columns(columns =>
{
columns.Bound(p => p.Ano).Width(50).Title("Año").HeaderHtmlAttributes(new { @style = "text-align:center;font-weight:bold" });
columns.Bound(p => p.PRODUCTO).Width(200).Title("Producto").HeaderHtmlAttributes(new { @style = "text-align:center;font-weight:bold" });
columns.Bound(p => p.DESCRIPCION_PRODUCTO).Width(300).Title("Descripción del Producto").HeaderHtmlAttributes(new { @style = "text-align:center;font-weight:bold" });
columns.Bound(p => p.SUBTOTAL_ENERO).Width(150).Title("Enero").Format("{0:#,###.00}").HtmlAttributes(new { @style = "text-align:right" }).HeaderHtmlAttributes(new { @style = "text-align:center;font-weight:bold" });
columns.Bound(p => p.SUBTOTAL_FEBRERO).Width(150).Title("Febrero").Format("{0:#,###.00}").HtmlAttributes(new { @style = "text-align:right" }).HeaderHtmlAttributes(new { @style = "text-align:center;font-weight:bold" });
columns.Bound(p => p.SUBTOTAL_MARZO).Width(150).Title("Marzo").Format("{0:#,###.00}").HtmlAttributes(new { @style = "text-align:right" }).HeaderHtmlAttributes(new { @style = "text-align:center;font-weight:bold" });
columns.Bound(p => p.SUBTOTAL_ABRIL).Width(150).Title("Abril").Format("{0:#,###.00}").HtmlAttributes(new { @style = "text-align:right" }).HeaderHtmlAttributes(new { @style = "text-align:center;font-weight:bold" });
columns.Bound(p => p.SUBTOTAL_MAYO).Width(150).Title("Mayo").Format("{0:#,###.00}").HtmlAttributes(new { @style = "text-align:right" }).HeaderHtmlAttributes(new { @style = "text-align:center;font-weight:bold" });
columns.Bound(p => p.SUBTOTAL_JUNIO).Width(150).Title("Junio").Format("{0:#,###.00}").HtmlAttributes(new { @style = "text-align:right" }).HeaderHtmlAttributes(new { @style = "text-align:center;font-weight:bold" });
columns.Bound(p => p.SUBTOTAL_JULIO).Width(150).Title("Julio").Format("{0:#,###.00}").HtmlAttributes(new { @style = "text-align:right" }).HeaderHtmlAttributes(new { @style = "text-align:center;font-weight:bold" });
columns.Bound(p => p.SUBTOTAL_AGOSTO).Width(150).Title("Agosto").Format("{0:#,###.00}").HtmlAttributes(new { @style = "text-align:right" }).HeaderHtmlAttributes(new { @style = "text-align:center;font-weight:bold" });
columns.Bound(p => p.SUBTOTAL_SEPTIEMBRE).Width(150).Title("Septiembre").Format("{0:#,###.00}").HtmlAttributes(new { @style = "text-align:right" }).HeaderHtmlAttributes(new { @style = "text-align:center;font-weight:bold" });
columns.Bound(p => p.SUBTOTAL_OCTUBRE).Width(150).Title("Octubre").Format("{0:#,###.00}").HtmlAttributes(new { @style = "text-align:right" }).HeaderHtmlAttributes(new { @style = "text-align:center;font-weight:bold" });
columns.Bound(p => p.SUBTOTAL_NOVIEMBRE).Width(150).Title("Noviembre").Format("{0:#,###.00}").HtmlAttributes(new { @style = "text-align:right" }).HeaderHtmlAttributes(new { @style = "text-align:center;font-weight:bold" });
columns.Bound(p => p.SUBTOTAL_DICIEMBRE).Width(150).Title("Diciembre").Format("{0:#,###.00}").HtmlAttributes(new { @style = "text-align:right" }).HeaderHtmlAttributes(new { @style = "text-align:center;font-weight:bold" });
columns.Bound(p => p.SUBTOTAL_TOTAL).Width(150).Title("Total").Format("{0:#,###.00}").HtmlAttributes(new { @style = "text-align:right;font-weight:bold" }).HeaderHtmlAttributes(new { @style = "text-align:center;font-weight:bold" });
})
.Groupable()
.Scrollable()
.Filterable()
.Pageable()
.DataSource(dataSource => dataSource
.Ajax()
.ServerOperation(false)
.Read(read => read.Action("Products_Read", "Grid"))
)
)
</p>
<p>
<input id="Submit1" type="submit" value="submit" /></p>
<div class="k-pager-wrap k-grid-pager" data-role="pager"><ul class="k-pager k-reset k-numeric"><a class="k-link k-state-disabled" title="Go to the first page" href="#" data-page="1"><a class="k-link k-state-disabled" title="Go to the previous page" href="#" data-page="1"><ul class="k-pager-numbers k-reset"><a class="k-link" title="Go to the next page" href="#" data-page="2"><a class="k-link" title="Go to the last page" href="#" data-page="3"><span class="k-pager-info k-label">1 - 10 of 28 items</span></div>$("#somepager").kendoPager( { dataSource: gridDatasource });
i want to use dataviz and web controls in the same page,so i add
<script src="kendo.web.min.js"></script>
<script src="kendo.dataviz.min.js"></script>
in my html page.
when i creating kendogrid with datasource such as
var dataSource = new kendo.data.DataSource({
transport: {
read: {
url: "getOperatorsByOrg.do?format=json&orgid=2",
dataType: "json"
}
},
batch: true,
pageSize: 30,
schema: {
model: {
fields: {
userid: { editable: false, nullable: true },
operatorname: { editable: false },
password: { editable: false }
}
}
}
});
$("#"+divname).kendoGrid({
dataSource: dataSource,
pageable: true,
height: 300,
toolbar: ["create"],
columns: [
{ field:"userid",title:"userid" },
{ field: "operatorname",title:"operatorname", width: "150px" },
{ field: "password", title:"password", width: "150px" }]
});
a javascript error is showed:
message: 'undefined' is null or is not an object
row: 8
char: 45249
code: 0
URI: http://localhost:8080/reportproject/views/js/kendo/kendo.web.min.js
and the data in grid can't be showed
when i delete the "<script src="kendo.dataviz.min.js"></script>"
the data can be showed very good
how i can do?