Telerik Forums
UI for ASP.NET MVC Forum
1 answer
102 views

I am using an MVC grid that has a toolbar, with a custom button

toolBar.Custom().Text("Recalculate Assets").Action("Edit", "AssetPlanning", new { recalculate = true }).HtmlAttributes(new { title = "Warning: This could take multiple minutes to fully complete", data_toggle = "tooltip", id = ("calcButton" + uniqueName), onClientClick = "alert('reclacing');" });

 

This actionresult can take upto a minute to run. I would at the very least like to update the button to say calculating with a little spinner and whatnot

 

var buttonID = "#calcButton" & String(@uniqueName.ToString());
 
$(buttonID).click(function () { recalculating(); });
 
 
function recalculating() {
 
    alert("reclacing");
 
    $(buttonID).addClass("btn btn-lg btn-warning");
    $(buttonID).html('<span class="glyphicon glyphicon-refresh glyphicon-refresh-animate"></span> Recalculating');
}

 

I would think that somewhere along the way the function would get called or an alert box would show, but nothing appears on the client side. I'm guessing that the action gets called first and the client click event just is never called. What can I do to make the client code called first or run together?

Dimiter Topalov
Telerik team
 answered on 11 Apr 2016
1 answer
103 views

 

I have a grid that has a column bound to it:

columns.Bound(p => p.FailureStrategyLookup).ClientTemplate("#=FailureStrategyLookup.FailureStrategy#").Width(100);

 

If the FailureStrategyLookup is NOT null, everything works fine. But when it IS NULL it can't bind the the object and I get an error saying "FailureStrategy" can't be found for a null value (or something to that affect). How can I get thsi working for a COMPLEX type when it's null?

 

public class FailureStrategyLookupViewModel
{
    [Required]
    public int FailureStrategyID { get; set; }
 
    [Required]
    [DisplayName("Maintenance Strategy")]
    public string FailureStrategy { get; set; }
}

ssdsdf

 

@using eRPortalDashboard.Models;
@using Kendo.Mvc.UI;
 
@model FailureStrategyLookupViewModel
 
@(Html.Kendo().DropDownListFor(m => m)
    .DataValueField("FailureStrategyID")
    .DataTextField("FailureStrategy")
    .BindTo((System.Collections.IEnumerable)TempData["FailureStrategyLookups"])
)

sadasd
Vladimir Iliev
Telerik team
 answered on 11 Apr 2016
2 answers
1.0K+ views

Hi
I have been going through an issue with Kend DropDownList's OptionLabel.

I have attached an image of the UI, if you see in it the optionLabel is kind of sticking to the top of the dropdown when I open it, even if I scroll the dropdown that option label keeps on showing plus its size is not like normal entry if you see the selected item highlighted in blue is comparatively wide vs the height of the option label.Also the second image with smaller drop down is also showing the same issue "Select Denial Reason" option label has smaller height compared to one of the values in dropdown like DENIED FUNCTIONAL etc.
Below is my code how I am defining it.
Please help me in tackling this issue so that optionlabel starts behaving normal.
Thanks
Rizwan

Helen
Telerik team
 answered on 11 Apr 2016
3 answers
378 views

Hi,

I have a Telerik UI Grid with a filterable column set to Multi, and Search set to True. Default placeholder text is "search".

How do I change this text?

 

Venelin
Telerik team
 answered on 11 Apr 2016
3 answers
257 views
Is it possible to make a toggle button to switch between the day, week and month view in a bar chart? 
Iliana Dyankova
Telerik team
 answered on 11 Apr 2016
3 answers
116 views
Hi,
I have problem with pannable key and events in diagram.

If I have Pannable key = "None"  (Pannable(p=>p.Key(DiagramPannableKey.None)))
then events Select and Click are dysfunctional.

I need Select event and pannable key = "None".
How can I solve this problem ?

Thanks
Daniel
Telerik team
 answered on 11 Apr 2016
3 answers
156 views

Hello

We have a Listview that populates with an IEnumerable<object>  The data source is set and the read called when a Kendo DropdownList.Change Event is called.

We have found that the first 1/2 the records with generate elements with data-uid, role="option" & aria-selected="false", while the latter 1/2 do not.  There is no difference in the records, if we add a single record to the list at a time, it will produce the same result, the first 1/2 with, the second 1/2 without.

 

we are using an external template (pls see below):

<script type="text/x-kendo-tmpl" id="availableAccessRightsTemplate">
<div style="padding: 8px 0 8px 10px;letter-spacing:.2px;">
<span data-toggle="tooltip" title="#= Description#">    #= DisplayName#   </span>
</div>
<hr style="margin-top: 0;margin-bottom: 0;" />
</script>

 

We see this behavior on 2 different ListViews, albeit on the same page with the same data types (objects).

 

Thanks for your help in advance

Nikolay Rusev
Telerik team
 answered on 11 Apr 2016
2 answers
1.1K+ views

So, I've tried to get this working following many threads and articles and I can't get it to work. The value posts back to the controller fine, but I can't get it to set the default selected item on the DropDownList nor can I get it to display the text of the selected item when I select an option. If I use a client template to try and grab the text, it throws an error (Cannot read property 'Text' of null) and won't show any items in the grid. For this one, I'm not using just an IEnumerable list of ViewModels (like most of the examples show) to populate the DropDownList, I'm using a SelectList. I have it working fine in another project with an IEnumerable list of ViewModels, but I just can get it working with a SelectList and I don't want to create a ViewModel for these static options. Please help! Thanks!

Here's my grid:

@(Html.Kendo().Grid<Tracker.Areas.Admin.Models.AdHocLocationViewModel>()
                                .Name("gridAdHocLocations")
                                .Columns(columns =>
                                {
                                    columns.Bound(c => c.LocationName).Title("Reviewer Location");
                                    columns.Bound(c => c.Packet).Title("Added to");
                                    columns.Bound(c => c.CreateDt).Title("Date Added").Width(120).Format("{0:MM/dd/yyyy}");
                                    columns.Bound(c => c.Action).Title("Selection").ClientTemplate("#=Action.Text#").Width(180);
                                })
                                .Editable(e => e.Mode(GridEditMode.InCell))
                                .ToolBar(t => t.Save())
                                .Sortable()
                                .Pageable(pageable => pageable
                                    .Refresh(true)
                                    .PageSizes(true)
                                    .ButtonCount(5))
                                .DataSource(dataSource => dataSource
                                    .Ajax()
                                    .PageSize(20)
                                    .Batch(true)
                                    .ServerOperation(false)
                                    .Model(s =>
                                    {
                                        s.Id(model => model.LocationId);
                                        s.Field(f => f.LocationName).Editable(false);
                                        s.Field(f => f.Packet).Editable(false);
                                        s.Field(f => f.CreateDt).Editable(false);
                                        s.Field(p => p.Action).DefaultValue(
                                            ViewData["defaultAction"] as SelectListItem);
                                    })
                                    .Read(read => read.Action("LocationsAdHoc_Read", "Location"))
                                    .Update(update => update.Action("LocationsAdHoc_Update", "Location"))
                                )
                            )

Here's my editor (I've also tried it strongly typed using DropDownListFor):

@(Html.Kendo().DropDownList()
    .Name("Action")
    .DataValueField("Value")
    .DataTextField("Text")
    .OptionLabel("Select Action")
    .BindTo((SelectList)ViewData["actions"])
)

Here's my model:

public class AdHocLocationViewModel
    {
        [ScaffoldColumn(false)]
        public int LocationId { get; set; }
        public string LocationName { get; set; }
        public string Packet { get; set; }
        public int ActionId { get; set; }
        public DateTime CreateDt { get; set; }
 
        [UIHint("AdHocLocationEditor")]
        public SelectListItem Action { get; set; }
    }

Ed
Top achievements
Rank 1
 answered on 08 Apr 2016
5 answers
187 views

Hi, 

When I'm using the export to excel function it works fine. But once I add an aggregate to the datasource as in one of the demos, I get the error attached.

Is one of my configurations wrong?

Your help will be much appreciated.

Thanks,

Waldo

My Code is as follows: 

 

@helper TreeGrid()
{
    <div>
    @(Html.Kendo().TreeList<OrgStructureViewModel>()
        .Name("treelist")
        .Columns(columns =>
        {
            columns.Add().Field(e => e.Full_Name)
               .FooterTemplate("<strong>#= count # employee(s)</strong>");
            columns.Add().Field(e => e.Emp_No);
            columns.Add().Field(e => e.Man_No).Hidden(true);
            columns.Add().Field(e => e.Division_ID).Template("#= Division #");
            columns.Add().Field(e => e.Title);
            columns.Add().Command(c => { c.Edit(); c.Destroy(); }).Width(220);
        })
        .Toolbar(x => { x.Create();  x.Excel(); x.Pdf(); })
        .Editable(x => x.Mode("popup"))
        .Filterable()
        .ColumnMenu(true)
        .Scrollable(true)
        .Sortable()
        .Resizable(true)
        .Excel(excel => excel
            .FileName("Reporting_Line.xlsx")
            .ProxyURL(Url.Action("Export_Save", "Reporting_Line"))
        )
        .Pdf(pdf => pdf
            .FileName("Reporting_Line.pdf")
            .ProxyURL(Url.Action("Export_Save", "Reporting_Line"))
        )
        .Events(ev => ev.Edit("onEdit"))
        .DataSource(dataSource => dataSource
            .Read(read => read.Action("Reporting_LineRead", "OrgStructure"))
            .Update(update => update.Action("Reporting_LineEdit", "OrgStructure"))
            .Create(create => create.Action("Reporting_LineAdd", "OrgStructure"))
            .Destroy(delete => delete.Action("Reporting_LineDelete", "OrgStructure"))
             .ServerOperation(false)
             .Aggregates(aggr =>
             {
                 aggr.Add(e => e.Full_Name).Count();
             })
            .Model(m =>
            {
                m.Id(f => f.Reporting_Line_ID);
                m.ParentId(f => f.ReportsTo);
                m.Field(f => f.Emp_No);
                m.Field(f => f.Man_No);
                m.Field(f => f.Division_ID);
                m.Expanded(false);
 
            })
        )
    )
}

 

 

<script type="text/javascript">   
    function onEdit(e) {
        console.log(e);
        if (!e.model.isNew()) {
            $("#Emp_No").data("kendoComboBox").enable(false);
        } else {
            $("#Division_ID").data("kendoDropDownList").enable(false);           
        }
    }
 
    function filterEmployees() {
        console.log($("#Emp_No").data("kendoComboBox").value());
        return {
            empNo: $("#Emp_No").data("kendoComboBox").value(),
            text: $("#Man_No").data("kendoComboBox").text()
        };
    }
</script>

 

​

Alex Gyoshev
Telerik team
 answered on 08 Apr 2016
2 answers
68 views

Hey,

I would like to pass an ID to my controller when the update event is fired on my grid.  Has anyone done this before?

.Update(update => update.Action("data_update", "Home"))

Viktor Tachev
Telerik team
 answered on 08 Apr 2016
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
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
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?