Telerik Forums
UI for ASP.NET MVC Forum
1 answer
32 views
http://www.telerik.com/forums/grid-create-and-remove-not-refreshing

This question is asked, and I have the exact same problem, but you didn't bother to answer the question so now I have to wait for an answer too and its from its from Nov 2013!
T. Tsonev
Telerik team
 answered on 04 Mar 2015
1 answer
199 views
Hi,

I'm trying to use the map to display the open and click results of an email campaign. When the page loads I want to display a bubble layer that represents the number of opens for the campaign. When the user clicks on certain panel in a panelbar, I want to instead display a bubble layer with the number of clicks for the campaign. I've been able to get it to switch back and forth successfully, but every time I do I encounter some nasty lag that I need to find a way to get rid of.

Here's the html for the map itself:
01.@(Html.Kendo().Map()
02.    .Name("CampaignMap")
03.    .Center(37.828127, -98.579404)
04.    .Zoom(4)
05.    .Zoomable(false)
06.    .Pannable(false)
07.    .Wraparound(false)
08.    .Controls(controls => controls.Navigator(false).Zoom(false))
09.    .Layers(layers =>
10.    {
11.        layers.Add()
12.            .Type(MapLayerType.Tile)
13.            .UrlTemplate("http://tile.openstreetmap.org/#= zoom #/#= x #/#= y #.png")
14.            //.Subdomains("a", "b", "c")
15.            .Attribution("© <a href='http://osm.org/copyright'>OpenStreetMap contributors</a>");
16. 
17.        layers.Add()
18.            .Type(MapLayerType.Bubble)
19.            .Style(style => style
20.                .Fill(fill => fill.Color("#00BFFF").Opacity(0.4))
21.                .Stroke(stroke => stroke.Width(0))
22.            )
23.            .DataSource(dataSource => dataSource
24.                  .Read(read => read.Action("InstCoords", "Email", new { id = @Model.CampaignId }))
25.            )
26.            .LocationField("Location")
27.            .ValueField("Opens");
28.    })
29.            )


This is the method the map reads from in my controller:
1.[AcceptVerbs(HttpVerbs.Post)]
2.public ActionResult InstCoords(int id)
3.{
4.    IEnumerable<CampaignInstOpens> coords = reportRepository.GetMapCoords(id);
5.    return Json(coords);
6.}


reportRepository.GetMapCoords(id) builds a SQL string which retrieves the number of opens, the number of clicks, latitude, and longitude for each building that was targeted by the campaign.

All of the above code seems to work fine on the initial page load - all of the data for number of opens displays in a bubble layer. What I'm trying to accomplish is when the user clicks a certain button I want to switch the bubble layer from using the "Opens" as the value field to using "Clicks," but this causes a huge amount of lag and freezes the page for several seconds. Like I said, my Read() function already grabs the data for both opens and clicks, so it seems to be like switching shouldn't be such a huge issue since it already has all the data it needs.

Here is the function I'm using to switch the value field:
01.function SwitchMap(e) {
02.    var index = $(e.item).index(); // this refers to a panelbar's selected index
03.    var layer = $("#CampaignMap").data("kendoMap").layers[1];
04.    if (index == 0) {
05.        layer.options.valueField = "Opens";
06.        layer.options.style.fill.color = "#00BFFF";
07.    }
08.    else {
09.        layer.options.valueField = "Clicks";
10.        layer.options.style.fill.color = "#008000";
11.    }
12.    layer.reset();
13.}

Can someone help me figure out how to switch back and forth between value fields without the horrible lag?
T. Tsonev
Telerik team
 answered on 04 Mar 2015
1 answer
139 views
Is there any way to add checkboxes to treeview nodes?

I like the treeview so far.  The columns and filtering are great features.  But the documentation is very sparse. 
Alex Gyoshev
Telerik team
 answered on 04 Mar 2015
3 answers
215 views
New user.  After installing the latest Telerik UI for ASP.NET MVC, and choosing File - New Project - Templates - Telerik - Web,  should I see a Kendo UI template project?  (I am watching the "The Basics of UI for ASP.NET MVC" video).

Or is there another step needed to install Kendo UI?
Michael
Top achievements
Rank 1
 answered on 03 Mar 2015
1 answer
182 views
Hi

We are currently working on a dashboard for a client which renders a number of charts at the same time.
The dashboard is driven by a commercial media device that is has low specifications and currently has trouble rendering the graphs correctly.

Is it possible to render the graphs as images? The dashboards do not required user interaction or animations.
Iliana Dyankova
Telerik team
 answered on 03 Mar 2015
1 answer
104 views
Just a sample to skin a slider via css, thought I'd share:
(vendor prefixes omitted for clarity)


.k-slider-track {
    background: linear-gradient(to bottom, rgba(199, 199, 199, 0.7) 5%, rgba(156, 156, 156, 0.1) 100%) repeat scroll 0 0 rgba(0, 0, 0, 0);
    border-color: #292929;
    border-radius: 2px;
    box-shadow: 0 -1px 0 rgba(0, 0, 0, 0.5) inset;
}

.k-slider-selection {
    background: linear-gradient(to bottom, rgba(199, 244, 199, 0.7) 5%, rgba(156, 224, 156, 0.1) 100%) repeat scroll 0 0 rgba(0, 0, 0, 0);
    border-color: #293329;
    border-radius: 2px;
    box-shadow: 0 -1px 0 rgba(0, 0, 0, 0.5) inset;
}

.k-draghandle {
  background: linear-gradient(to bottom, rgba(199, 244, 199, 0.7) 5%, rgba(156, 224, 156, 0.1) 100%) repeat scroll 0 0 rgba(0, 0, 0, 0);
  border-color: #294429;
  border-radius: 2px;  
}

.k-tick-large {
  display:none;  
}
Iliana Dyankova
Telerik team
 answered on 03 Mar 2015
7 answers
1.0K+ views
I've bound the event, and tried the pre-initialization and post-initialization binding :

(post initialization snippet)
editor.bind("paste", function(e) {
e.html = unescape(e.html);
});

However, the function only fires the second time that I paste a value into the editor.

Any suggestions would be appreciated.

Dean Wise
Alex Gyoshev
Telerik team
 answered on 02 Mar 2015
1 answer
78 views
Hi,

We have a grid with a foreignkey column. This column has to call an edit template Dropdownlist with cascade property .

columns.ForeignKey(f => f.CatalogReference, (System.Collections.IEnumerable)ViewBag.Cataleg, "Reference",          "Descripcio").EditorTemplateName("CatalegReferenceByType");

@model object
(Html.Kendo().DropDownList()
    .Name("CatalogReference")
    .AutoBind(true)
    .OptionLabel("Select reference...")
    .DataTextField("Descripcio")
    .DataValueField("Reference")
    //.HtmlAttributes(new { data_skip = "true", data_bind = "defferedValue: object" })           //.BindTo((SelectList)ViewData[ViewData.TemplateInfo.GetFullHtmlFieldName("") + "_Data"])
    .DataSource(source => {
           source.Read(read => read.Action("PopulateReferences", "Catalog").Data("filterTypes"))
          .ServerFiltering(true); })
    .CascadeFrom("Tipus")
    .HtmlAttributes(new { id = Guid.NewGuid().ToString() })
)

It's possible show the value in dropdownlist when update state is selected.


Thanks for your responds.


Xavier.
Alexander Popov
Telerik team
 answered on 02 Mar 2015
1 answer
101 views
I just downloaded and installed UI for ASP.NET MVC - I'm evaluating it for a potential purchase.

Although I have VS 2012 Pro and VS 2013 Express for Web installed, the installed did not recognize the 2013 installation and therefore can't install the VS extensions. It did recognize VS 2012 but I'm planning to use 2013, so this is a handicap.

I've seen a few old messages on this topic but I believe it's supposed to be working now.

Any advice welcome!

Thanks, Tom
Steliyan
Telerik team
 answered on 02 Mar 2015
1 answer
167 views
Hello Guys,


I have the following dropdownlist with a custom template:

        Html.Kendo()
           .DropDownList()
           .HtmlAttributes(new { style = "width:100%; " })
           .BindTo(Model.FilterShops)
           .DataTextField("DisplayValue")
           .DataValueField("Id")
           .Template("<input type='checkbox' id='#=data.Id #' name='superPlayer#=data.Id #' value='#=data.IsSelected #' />" + "   " + "${ data.DisplayValue}")
           .Name("cb_SuperPlayer")
           .Events(ev => ev.Close("cb_SuperPlayer_closed"))
           .Filter(FilterType.Contains)

If i open the dropdownlist and check some of the checkboxes, on the close event i will correctly get the ones checked into an array. 
The problem is when i use the search textbox of the control to filter the items, if i check some of them, after the dropdownlist closes the selections are all cleared..

So for example lets say that my collection has: [Whatever, Test1, Test2, SomeOtherText]. If i just open the dropdownlist and select whatever and test1 and then close it, after i collapse it again, my checkboxes are still checked.

If i open the dropdownlist and search for "test", and check test1, test2, close the dropdownlist and then collapse it again, the two selections are cleared.

Hope you can help me figure this out.

P.S: This is the method for onclosed to get the checked selections

      function cb_SuperPlayer_closed() {
        var selShops = new Array();
        var doc = document.getElementById("cb_SuperPlayer_listbox");
        var chkBoxes = doc.getElementsByTagName("input");
        for (var i = 0; i < chkBoxes.length; i++) {
            if (chkBoxes[i].checked)
                selShops.push(chkBoxes[i].id);
        }

    }

Regards,


Fran









Alexander Popov
Telerik team
 answered on 02 Mar 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?