Telerik Forums
UI for ASP.NET Core Forum
3 answers
270 views

i use the follow code, but it is not working

var listbox=$('#listboxname').data('kendoListBox')

2018 r3

 

Tsvetomir
Telerik team
 answered on 14 Nov 2018
2 answers
313 views

I want to see the saved date in the text box on the edit page.  Everything works ok on my create page but for some reason I can't get the value to show on my edit page.

This will display the date:

  @Model.UsrRequest.Start

This does not:

@(Html.Kendo().DatePicker().Name("UsrRequest.Start").Value("Model.UsrRequest.Start"))

What am I missing?

 

 

May
Top achievements
Rank 1
 answered on 13 Nov 2018
1 answer
199 views

I have the following dropdownlistfor:

                            @(Html.Kendo().DropDownListFor(x => x.SelectedInvoicingCompanyId)
                                  .HtmlAttributes(new { @class = "form-control" })
                                  .BindTo(ViewData["allInvoicingCompanies"] as IEnumerable)
                                  .DataTextField("Name")
                                  .DataValueField("Id")
                                  .OptionLabel(new { Name = "Select company", Id = 0 }))

 

This works fine in another view with the exact same source. However i have this grid with popup edit and a custom popup edit template with this dropdownlist. In this popup edit template the dropdownlist displays as a textbox and the SelectedInvoicingCompanyId number i.e. "1".

When i press the edit button i also get the following error from jQuery:

Uncaught SyntaxError: Invalid or unexpected token
    at m (jquery-3.3.1.min.js:2)
    at Re (jquery-3.3.1.min.js:2)
    at w.fn.init.append (jquery-3.3.1.min.js:2)
    at I.fn.init.w.fn.(anonymous function) [as appendTo] (https://ajax.aspnetcdn.com/ajax/jquery/jquery-3.3.1.min.js:2:50106)
    at init._createPopupEditor (kendo.all.js:58951)
    at init.editRow (kendo.all.js:58796)
    at HTMLAnchorElement.<anonymous> (kendo.all.js:58532)
    at HTMLDivElement.dispatch (jquery-3.3.1.min.js:2)
    at HTMLDivElement.y.handle (jquery-3.3.1.min.js:2)

 

I can not get my head around this. I had it working some time ago, and i think it started acting this way after i updated to 2018.3.1017.

I have other dropdownlistfor in this popup edit template which are working as they should. So it's only this specific dropdownlist that doesn't load as it should.

This is one example of a working dropdownlist in the same view:

            @(Html.Kendo().DropDownListFor(x => x.SelectedPMId)
                  .HtmlAttributes(new { @class = "form-control" })
                  .BindTo(ViewData["allUsers"] as IEnumerable)
                  .DataTextField("DisplayName")
                  .DataValueField("Id")
                  .OptionLabel("Select User")
                  .Filter("contains"))

Veselin Tsvetanov
Telerik team
 answered on 12 Nov 2018
2 answers
38 views

Hello,

I have developed an MVC application that uses Kendo Grid to display database tables dynamically on user request. I have received a request to implement 'bookmarking' of the grid state at certain points, i.e: if the user has progressed through the system to load a specific schema/table, they would like a link or some sort of 'bookmarked reference' to instantly load the grid without having to traverse through the controls again. I'm not sure how realizable this is.. the controller reference of course can be bookmarked, but this will just return the raw Json that populates the grid.. is there anyway for an end-user to pass around a reference that would instantly reload the grid in a specific state?

John
Top achievements
Rank 1
 answered on 09 Nov 2018
2 answers
431 views

We have implemented a scheduler on an mvc page:

01.@(Html.Kendo().Scheduler<SchedulerBasicCore.Models.ScheduleViewModel>()
02.    .Name("scheduler")
03.    .Date(DateTime.UtcNow)
04.    .Editable(false)
05.    .Height(600)
06.    .Toolbar(t => t.Pdf())
07.    .AutoBind(true)
08.    .Views(views =>
09.    {
10.        views.DayView();
11.        views.WeekView(weekView => weekView.Selected(true));
12.        views.MonthView();
13.        views.AgendaView();
14.    })
15.    .Timezone("Etc/UTC")
16.    .DataSource(d => d
17.    .WebApi()
18.    .Model(m =>
19.    {
20.         m.Id(f => f.EventId);
21.         m.Field(f => f.Title).DefaultValue("No title");
22.    })
23.    .Read(read => read.Action("Schedules_Read", "Scheduler").Data("getAdditionalData"))
24.     )
25.)
26.
27.<script>
28.    function getAdditionalData() {
29.        var scheduler = $("#scheduler").data("kendoScheduler");
30.
31.        var result = {
32.            start: scheduler.view().startDate().toISOString(),
33.            end: scheduler.view().endDate().toISOString()
34.        }
35.
36.        return result;
37.    }
38.</script>

 

 

This calls through to an API and this all work successfully.

 

However, as i scroll through weeks or different views the api is called until some data is successfully returned. Once data is successfully returned no further changes of the views or scrolling through the dates result in an api call.

 

So I am wondering what I need to do to support loading data per view or date change?

 

Thanks

 

 

Sam

Sam
Top achievements
Rank 1
 answered on 07 Nov 2018
4 answers
201 views

Hello,

Is it possible to fill my gauge through my controller?

In a bar chart you can do for example:

.DataSource(ds => ds.Read(read => read.Action("CNTRLLERFUNC", "CNTRLLERNANE")))

How can I perform this for in a gauge? And I don't want this to be done through a model.

Chili
Top achievements
Rank 1
 answered on 07 Nov 2018
1 answer
110 views
How to set the z-index of the chart line series so that the y-axis line does not cover it? Thanks.
Tsvetina
Telerik team
 answered on 07 Nov 2018
1 answer
101 views
Borrowing code from this page: https://demos.telerik.com/kendo-ui/grid/persist-state 
I added save/load buttons to my grid's toolbar.  I'm outputting the data in the console that gets saved and loaded, and they appear to match perfectly, however, when I load the data I've saved, the grid displays no data. 

Any idea what I'm doing wrong here?
function LoadPrefs() {
    var grid = $("#Inspections").data("kendoGrid");
    var options = localStorage["kendo-grid-options"];
    console.log(JSON.parse(options));
    if (options) {
        grid.setOptions(JSON.parse(options));
    }
}
function SavePrefs() {
    var grid = $("#Inspections").data("kendoGrid");
    var opts = grid.getOptions();
    console.log(opts);
    localStorage["kendo-grid-options"] = kendo.stringify(opts);
}
Tsvetomir
Telerik team
 answered on 06 Nov 2018
1 answer
353 views

I'm trying to use the MultiSelect widget to show tags on an object and allow the users to add new ones dynamically that will get created as they add them (and linked to the object upon save of the page). I'm basing the work on the following example:

    https://demos.telerik.com/kendo-ui/multiselect/addnewitem

However, I'm trying to do this with the ASP.NET Core widget, and I'm running into problems when trying to set up the datasource. It appears I can only add a Read method and cannot add a Create similar to the above linked example. 

Is this not supported in the ASP.NET Core version? Or is there a ASP.NET Core example somewhere on the site that I just can't find?

 

 

Tsvetomir
Telerik team
 answered on 06 Nov 2018
0 answers
62 views

How to create columns dynamically

According to configuration file

<config>
  <parameter Name="编号材料" FieldName="MATERIAL"  Width="80"  Desc="在用" />
  <parameter Name="储位编号" FieldName="STORAGEMATRIX"  Width="10"  Desc="在用" />
  <parameter Name="材料类别ID" FieldName="CLASS"  Width="10"  Desc="在用" />  
</config>

<config>
  <parameter Name="供应商名称" FieldName="PROVIDERNAME" Width="120" Desc="在用" />
  <parameter Name="供应商编号" FieldName="PROVIDERCODE"  Width="80"  Desc="在用" />
</config>

ghd258 ghd258
Top achievements
Rank 1
 asked on 06 Nov 2018
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?