@(Html.Kendo().Grid(Model) _ .Name("MaintenanceTickets") _ .Columns(Function(modelItem) modelItem.Bound(Function(p) p.CreateDate).Format("{0:d}").Title("Created")) _ .Columns(Function(modelItem) modelItem.Bound(Function(p) p.Originator).Width(100)) _ .Columns(Function(modelItem) modelItem.Bound(Function(p) p.CustomerName).Title("Customer").Width(100)) _ .Columns(Function(modelItem) modelItem.Bound(Function(p) p.Description)) _ .Columns(Function(modelItem) modelItem.Bound(Function(p) p.OntimeAssignedTo).Title("Assigned").Width(100)) _ .Columns(Function(modelItem) modelItem.Bound(Function(p) p.Description)) _ .Columns(Function(modelItem) modelItem.Bound(Function(p) p.Priority.Name).Title("Priority").Width(75)) _ .Columns(Function(modelItem) modelItem.Bound(Function(p) p.Status.Name).Title("Status").Width(75)) _ .Columns(Function(modelitem) modelitem.Bound("Id").Title("Actions").Template(Sub(item)@<text> <a href="@url.Action("Details", "Ticket")/@item.Id">Details</a> <a href="/Ticket/Edit/@item.Id">Edit</a> </text> End Sub)) _ .Pageable(Function(page) page.PageSizes(5)) _ .Sortable() _ .Filterable() _ .Resizable(Function(resize) resize.Columns(True)) _ .ColumnMenu() )@(Html.Kendo().Grid<BuyItNow.Models.LineItemViewModel>().HtmlAttributes(htmlAttributes) .Name("kendoGrid") .EnableCustomBinding(true) .BindTo(Model.Data) .Events(events => events.DataBound("dataBound")) .Columns(columns => { columns.Bound(p => p.lineNumber); columns.Bound(p => p.partNum).Title("Part#").EditorTemplateName("PartNumber"); columns.Bound(p => p.partDescription).EditorTemplateName("Description"); columns.Bound(p => p.unitOM).EditorTemplateName("UOM").Equals("EA"); columns.Bound(p => p.partQuant).EditorTemplateName("Number").Format("{0:n0}"); }) .ToolBar(toolbar => { toolbar.Create(); toolbar.Save(); }) .Editable(editable => editable.Mode(GridEditMode.InCell)) .Pageable() .Sortable() // .Scrollable() .Navigatable() .DataSource(dataSource => dataSource .Ajax() .Total(Model.Total) .Batch(true) .ServerOperation(false) .Events(events => events.Error("error_handler")) .Model(model => { model.Id(p => p.itemID); model.Field(p => p.lineNumber).Editable(false).DefaultValue("0000"); }) .Create(update => update.Action("_Create", "LineItems")) .Read(read => read.Action("_Read", "LineItems")) .Update(update => update.Action("_Update", "LineItems")) ).Resizable(resize => resize.Columns(true))$(document).ready(function() { var grid = $("#kendoGrid").data("kendogrid"); // bind to the edit event grid.bind("edit", function (e) { debugger; e.preventDefault(); e.container.find('input:last').focus() } });Hello,
In the attached screen print I added the HTML version 2012.2 913 of editor and MVC version code snippet from the view all http://demos.kendoui.com/web/editor/all-tools.html. The HTML version has the (View HTML) the MVC version does not have this button. I also tried the latest internal build 2012.2.1029 this did not have the feature. In the Razor file when I add .Tools(tools => tools . viewHtml is not listed as a tool.
Below is the sample code I used to generate this. And attached is a screen print.
With regards,
Matthew
Sample Index.cshtml file
@{
ViewBag.Title = "Index";
}
<h2>HTML Editor</h2>
<div id="example" class="k-content">
<textarea id="editor" rows="10" cols="30" style="width:740px;height:400px">
<p><img src="http://www.kendoui.com/Image/kendo-logo.png" alt="Editor for ASP.NET MVC logo" style="display:block;margin-left:auto;margin-right:auto;" /></p>
<p>
Kendo UI Editor allows your users to edit HTML in a familiar, user-friendly way.<br />
In this version, the Editor provides the core HTML editing engine, which includes basic text formatting, hyperlinks, lists,
and image handling. The widget <strong>outputs identical HTML</strong> across all major browsers, follows
accessibility standards and provides API for content manipulation.
</p>
<p>Features include:</p>
<ul>
<li>Text formatting & alignment</li>
<li>Bulleted and numbered lists</li>
<li>Hyperlink and image dialogs</li>
<li>Cross-browser support</li>
<li>Identical HTML output across browsers</li>
<li>Gracefully degrades to a <code>textarea</code> when JavaScript is turned off</li>
</ul>
<p>
Read <a href="http://docs.kendoui.com">more details</a> or send us your
<a href="http://www.kendoui.com/forums.aspx">feedback</a>!
</p>
</textarea>
<script>
$("#editor").kendoEditor({
tools: [
"bold",
"italic",
"underline",
"strikethrough",
"fontName",
"fontSize",
"foreColor",
"backColor",
"justifyLeft",
"justifyCenter",
"justifyRight",
"justifyFull",
"insertUnorderedList",
"insertOrderedList",
"indent",
"outdent",
"formatBlock",
"createLink",
"unlink",
"insertImage",
"subscript",
"superscript",
"viewHtml"
]
});
</script>
</div>
<h2>MVC Editor</h2>
@(Html.Kendo().Editor()
.Name("Editor")
.HtmlAttributes(new { style = "width: 740px;height:440px" })
.Tools(tools => tools
.SubScript()
.SuperScript()
)
.Value(@<text>
<p>
<img src="http://www.kendoui.com/Image/kendo-logo.png" alt="Editor for ASP.NET MVC logo" style="display:block;margin-left:auto;margin-right:auto;" />
</p>
<p>
Kendo UI Editor allows your users to edit HTML in a familiar, user-friendly way.<br />
In this version, the Editor provides the core HTML editing engine, which includes basic text formatting, hyperlinks, lists,
and image handling. The widget <strong>outputs identical HTML</strong> across all major browsers, follows
accessibility standards and provides API for content manipulation.
</p>
<p>Features include:</p>
<ul>
<li>Text formatting & alignment</li>
<li>Bulleted and numbered lists</li>
<li>Hyperlink and image dialogs</li>
<li>Cross-browser support</li>
<li>Identical HTML output across browsers</li>
<li>Gracefully degrades to a <code>textarea</code> when JavaScript is turned off</li>
</ul>
<p>
Read <a href="http://www.kendoui.com/documentation/introduction.aspx">more details</a> or send us your
<a href="http://www.kendoui.com/forums.aspx">feedback</a>!
</p>
</text>)
)
| <div id="window"></div><script> | |
| jQuery(function(){jQuery("#window").kendoWindow({"modal":true,"iframe":false,"draggable":true,"title":"test","resizable":false,"content":"/login","actions":["Close"]});}); | |
| </script> |
TypeError: jQuery("#Menu").kendoMenu is not a function