<div id="tree"></div><script>var flatData = [ { id: 1, parent: null, text: "Item 1" }, { id: 2, parent: null, text: "Item 2" }, { id: 3, parent: null, text: "Item 3" }, { id: 4, parent: null, text: "Item 4" }, { id: 5, parent: 1, text: "Item 1.1" }, { id: 6, parent: 1, text: "Item 1.2" }, { id: 7, parent: 1, text: "Item 1.3" }, { id: 8, parent: 3, text: "Item 3.1" }, { id: 9, parent: 3, text: "Item 3.2" }, { id: 10, parent: 5, text: "Item 1.1.1" }, { id: 11, parent: 5, text: "Item 1.1.2" }, { id: 12, parent: 5, text: "Item 1.1.3" }];// tree for visualizing data$("#tree").kendoTreeView({ dataSource: { transport: { read: function(options) { var id = options.data.id || null; options.success($.grep(flatData, function(x) { return x.parent == id; })); } }, schema: { model: { id: "id", hasChildren: function(x) { var id = x.id; for (var i = 0; i < flatData.length; i++) { if (flatData[i].parent == id) { return true; } } return false; } } } }})</script>Hi guys,
I've setup a datepicker, it's showing the selected date properly but I'm having a hard time in sending it towards my controller in the same format it's showing. For some reason it seems to be reverting back from dd/MM/yyyy to MM/dd/yyyy.
Below my script used.
01.<script>02. var datepicker;03. $(document).ready(function () {04. datepicker = $("#datepicker").data("kendoDatePicker");05. 06. $("#btnToReport").click(function () {07. $.post("/ShiftReport/ViewReport?datepicker=" + datepicker.value().toLocaleString(), function (data, status) {08. if (status === "success") {09. $("#main-content").html(data);10. 11. }12. });13. });14. });15.</script>Hi all,
we are implementing a grid using asp.net mvc and aspx pages. We are encountering a couple of problems using templates because it seems
that Visual Studio 2013 does not recognize the object implementation correctly. The error returned by Visual Studio is the CS1525:Invalid expression term ')'.. This is our code with the comments..
<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/SiteEnvironment.Master" Inherits="System.Web.Mvc.ViewPage<MyApp.Models.EnvTblModel>" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<h2>Environment List</h2>
<%:
Html.Kendo().Grid<MyApp.Models.EnvTblModel>()
.Name("Grid")
.BindTo((IEnumerable<MyApp.Models.EnvTblModel>)ViewBag.EnvironmentList)
.Columns(colList =>
{
foreach (var runCol in ViewBag.colSchLst)
{
colList.Bound(runCol.TBS_BOUND_FIELD_NAME).Title(runCol.TBS_COLUMN_NAME);
}
colList.Bound(p =>
p.TBG_FILLER_CHK01).Template(p =>
{ /*VISUAL STUDIO GIVES THE ERROR CS1525: Invalid expression term ')' HERE .. */
%>
<strong><%: p.TBG_FILLER_CHK01 %></strong> //THIS BLOCK SEEMS NOT RECOGNIZED
<%
});
});
%>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="FeaturedContent" runat="server">
</asp:Content>
Thank you in advance for your help..
Regards
<div> @using (Html.BeginForm("SignIn", "Account", FormMethod.Post, new { @class = "form-horizontal", role = "form", autocomplete="off" })) { @Html.AntiForgeryToken() <dl class="dl-horizontal"> <dt> @Html.LabelFor(x => x.UserName) </dt> <dd> @Html.TextBoxFor(x => x.UserName, new {@id="user_name", @disabled="true"}) </dd> <dt> @Html.LabelFor(x => x.Password) </dt> <dd> @Html.PasswordFor(x => x.Password, new {@id="password", @autocomplete="off" , @disabled="true"}) </dd> <dt> @Html.LabelFor(x => x.StoreNum) </dt> <dd> @(Html.Kendo().DropDownListFor(x => x.StoreNum) .DataSource(ds => ds .Read(r=> r.Action("GetStoreList", "Account"))) .HtmlAttributes(new {@id="store_list",@disabled="true" }) ) </dd> <dd> <input type="submit" value="Log in" class="btn btn-default" disabled="true" id="login_button" /> </dd> </dl> } </div>
I have a drop down list that reads data from my controller. I need to enable fields and a button in the UI after the data is loaded into the dropdownlist. How can I do this?
Hello,
I would like to catch the grid request i.e. when sorting or grouping via server and execute on some modal dialog when OK clicked. As I understand on requestStart we can perform some actions, but further execution flow will proceed. In my case I would like to display login dialog + some other login selections and if login succeeds, continue with the request. Is it possible?
Thanks
[DataType("number")]public double Percent{ get { return (double)Math.Round(source.Percent, 5); } set { source.Percent = (decimal)value; }}.Columns(columns =>{ columns.Bound(c => c.Percent).Title(Resource.Percent).Format("{0:n5}");var c = '@System.Globalization.CultureInfo.CurrentCulture.ToString()'kendo.culture(c);.Pageable(p => p.Refresh(true) .ButtonCount(10) .PageSizes(new[] { 10, 25, 100, 200, 1000 }) .Input(true) ).k-pager-wrap .k-dropdown{ width: 280px; }var ddl = $('[data-role="dropdownlist"]').data("kendoDropDownList");ddl.list.width(100);Hi,
How do I add a default filter on a kendo.grid ?
I have a filter on a boolean, which is working just fine, but I would like TRUE to be the selection by default.
I am quite sure that I have done this before and then removed it again, and now I can't remember howto :-(
I'am aware, that server side operations require more than just setting the default filter selection, but once I have figured out how to set the filter in the view, then I figure out the rest.
So, how to set default filter in the view ??
Thank you in advance.
It is probably easy as you might say it is. But the fact remains is that I can not find the solution anywhere.
Here is my code:
public ActionResult Edit([DataSourceRequest] DataSourceRequest gridRequest, Sub editSub)
{
if (ModelState.IsValid)
{
Sub subToUpdate = db.Subs.FirstOrDefault();
subToUpdate.SFirst = editSub.SFirst;
subToUpdate.SLast = editSub.SLast;
subToUpdate.SEmail = editSub.SEmail;
db.SaveChanges();
}
return Json(new[] { editSub }.ToDataSourceResult(gridRequest, ModelState));
}
Every time I modify a different row the first row gets overwritten. I assume that I nee to specify the ID in here: db.Subs.FirstOrDefault();
I cannot find how to?