Hi,
I'm pretty new to ASP .Net Core but I have read on microsoft site that code written with it can be run on the browswer and can be used to create UI. So, If all this can be done with ASP .Net Core why is people pairing it with Angular? I known there's something I'm missing here but don't know what.
I would really appreciate it if anyone could clarify it.
Cheers!
Template code:
@(Html.Kendo().TreeList<EmployeeDirectoryModel>()
.Name("treelist")
.Toolbar(toolbar => toolbar.Create())
.Columns(columns =>
{
columns.Add().Field(e => e.FirstName).Title("First Name").Width(220);
columns.Add().Field(e => e.LastName).Title("Last Name").Width(200);
columns.Add().Field(e => e.Position);
columns.Add().Field(e => e.HireDate).Format("{0:MMMM d, yyyy}");
columns.Add().Width(350).Command(c =>
{
c.CreateChild().Text("Add child");
c.Edit();
c.Destroy();
})
.HtmlAttributes(new
{
style = "text-align: center;"
});
})
.Editable()
.DataSource(dataSource => dataSource
.Read(r => r.Url("/Employees/Index?handler=Read").Data("forgeryToken")) // Specify the url to the OnPostRead method.
.Update(u => u.Url("/Employees/Index?handler=Update").Data("forgeryToken"))
.Create(c => c.Url("/Employees/Index?handler=Create").Data("forgeryToken"))
.Destroy(d => d.Url("/Employees/Index?handler=Destroy").Data("forgeryToken"))
.Model(m =>
{
m.Id(f => f.EmployeeId); // Provide the Id property of the model.
m.ParentId(f => f.ReportsTo); // Provide the Child Id property of the model.
m.Expanded(false); // Set to true if you want the TreeList to be expanded by default.
m.Field(f => f.FirstName);
m.Field(f => f.LastName);
m.Field(f => f.ReportsTo);
m.Field(f => f.HireDate);
m.Field(f => f.Position);
})
)
.Height(540)
)
Headers request:
Response:
{
"data": [
{
"employeeId": 1,
"firstName": "Daryl",
"lastName": "Sweeney",
"reportsTo": null,
"position": "CEO",
"hasChildren": false,
"hireDate": "2022-02-19T14:02:27.590078+07:00"
},
{
"employeeId": 2,
"firstName": "Guy",
"lastName": "Wooten",
"reportsTo": 1,
"position": "Chief Technical Officer",
"hasChildren": false,
"hireDate": "2022-02-20T14:02:27.590084+07:00"
},
{
"employeeId": 3,
"firstName": "Buffy",
"lastName": "Weber",
"reportsTo": 2,
"position": "VP, Engineering",
"hasChildren": false,
"hireDate": "2022-02-21T14:02:27.5900853+07:00"
},
{
"employeeId": 4,
"firstName": "Hyacinth",
"lastName": "Hood",
"reportsTo": 3,
"position": "Team Lead",
"hasChildren": false,
"hireDate": "2022-02-22T14:02:27.5900856+07:00"
},
{
"employeeId": 5,
"firstName": "Akeem",
"lastName": "Carr",
"reportsTo": 4,
"position": "Junior Software Developer",
"hasChildren": false,
"hireDate": "2022-02-23T14:02:27.590086+07:00"
},
{
"employeeId": 6,
"firstName": "Rinah",
"lastName": "Simon",
"reportsTo": null,
"position": "Software Developer",
"hasChildren": false,
"hireDate": "2022-02-24T14:02:27.5900865+07:00"
},
{
"employeeId": 7,
"firstName": "Gage",
"lastName": "Daniels",
"reportsTo": 6,
"position": "Software Architect",
"hasChildren": false,
"hireDate": "2022-02-25T14:02:27.5900868+07:00"
},
{
"employeeId": 8,
"firstName": "Constance",
"lastName": "Vazquez",
"reportsTo": 6,
"position": "Director, Engineering",
"hasChildren": false,
"hireDate": "2022-02-26T14:02:27.5900871+07:00"
},
{
"employeeId": 9,
"firstName": "Darrel",
"lastName": "Solis",
"reportsTo": 8,
"position": "Team Lead",
"hasChildren": false,
"hireDate": "2022-02-27T14:02:27.5900874+07:00"
},
{
"employeeId": 10,
"firstName": "Brian",
"lastName": "Yang",
"reportsTo": 9,
"position": "Senior Software Developer",
"hasChildren": false,
"hireDate": "2022-02-28T14:02:27.5900878+07:00"
},
{
"employeeId": 11,
"firstName": "Lillian",
"lastName": "Bradshaw",
"reportsTo": 9,
"position": "Software Developer",
"hasChildren": false,
"hireDate": "2022-03-01T14:02:27.5900882+07:00"
}
],
"total": 11,
"aggregateResults": {},
"errors": null
}
UI result:
Hi,
I'm trying to set the maximum length of input characters using HtmlAttributes in a form. But it seems it doesn't work; I can still type more than 4 characters. Here is an example in REPL:
https://netcorerepl.telerik.com/wmkmbflo51nxiZPb01
i.Add()
.Field(f => f.FirstName)
.Editor(e=> e.TextBox().HtmlAttributes(new { maxlength = "4" }))
.Label(l => l.Text("First Name:"));
Thanks,
Humberto
Hello,
PDF search is not working when PDF viewer is placed in modal. Is there any workaround for this?
Thanks.
@(Html.Kendo().TreeList<SiteMapTreeModel>()
.Name(
"treelist"
)
.Columns(columns =>
{
columns.Add().Field(c => c.Title).Title(
"Title"
).Width(250);
columns.Add().Field(c => c.Url).Title(
"URL"
);
})
.DataSource(dataSource => dataSource
.Read(read => read.Action(
"SiteMapTree"
,
"HomeAjax"
).Data(
"getServiceAndLocale"
))
.Model(model =>
{
model.Id(m => m.Id);
model.ParentId(m => m.ParentId);
model.Field(m => m.Title);
model.Field(m => m.Url);
})
)
.AutoBind(
false
)
.Selectable(
true
)
.Deferred()
.Height(540))
{
"Data"
:[{
"Id"
:1602,
"ParentId"
:1000,
"Title"
:
"Dashboard"
,
"Url"
:
"~/Dashboard/Start"
,
"hasChildren"
:
true
},{
"Id"
:22,
"ParentId"
:1000,
"Title"
:
"Rules"
,
"Url"
:
"~/Rules/Start"
,
"hasChildren"
:
true
},{
"Id"
:1,
"ParentId"
:1000,
"Title"
:
"Administration"
,
"Url"
:
"~/Admin/Start"
,
"hasChildren"
:
true
}],
"AggregateResults"
:{},
"Errors"
:
null
}
<div class="form-group">
<label asp-for="Summ">Стоимость от</label>
@(Html.Kendo().NumericTextBox<decimal>()
.Name("Summ")
.Min(0)
.Value(Model.Summ)
.HtmlAttributes(new { style = "width: 100%" })
)
</div>
public class ServiceViewModel
{
......
public decimal Summ { set; get; }.....
}
var supportedCultures = new[] { new CultureInfo("ru-RU") };
app.UseRequestLocalization(new RequestLocalizationOptions
{
DefaultRequestCulture = new RequestCulture("ru-RU"),
SupportedCultures = supportedCultures,
SupportedUICultures = supportedCultures
});
<script src="~/lib/kendo/js/cultures/kendo.culture.ru-RU.min.js"></script>
Hi
I would like to filter a string column with multiple keyword, can you advice how I can do that?
example. country column, filter by entering "USA, UK, India";
I know I can set checkbox filter menu, but I would like user to enter the test instead.
Thank you.
in the form using tag helpers, how can I set textbox-editor as password?
<form-item field="Password">
<item-label />
<textbox-editor ></textbox-editor> ???????????
</form-item>