Telerik Forums
Kendo UI for jQuery Forum
3 answers
93 views
I'm using a grid which sometimes needs to be regenerated. But if the filtermenus with datetimepicker is used before the grid is regenerated the filter wont work for the new grid.

Here's a jsfiddle example:
http://jsfiddle.net/YF7gS/2/

To reproduce:
1. Click Create grid.
2. Select a date-filter
3. Click Create grid again.
4. Now the select filter is not working.

(So far I only tried firefox, but I don't think he browser matters)

This worked before updating Kendo (from 2012Q3(?) to 2013Q3)
Petur Subev
Telerik team
 answered on 07 Feb 2014
8 answers
248 views
I've been tasked w/ creating a wizard-like, information collection workflow using Kendo MVVM. It was suggested SPA might be a good fit for this project. The basic idea is asking the user at the beginning which options they'd like to include, and then based on those choices, allow the user to configure each in detail using a Next page, previous page "wizard like" workflow. Does this sound like a good use for Kendo SPA? 

One of my concerns is my view model(s) getting too large. I might be able to mitigate this w/ proper object oriented Javascript class composition, but in general, should viewmodel size be a concern w/ SPA? The other concern is having to create a lot of new kendo.View instances to house all the different "content" areas of each pages. In total, there easily could be 40-50 different views for the different content.

I've seen the kendo music store SPA app as well as sushi, but these are very simple apps with only a small handful of different content views. 
Surely I wouldn't want to keep those in memory, right? Any insight on if this is a good idea (and if so) would be the best way to architect the application, would be most helpful. 

I'm sorry if this question seems elementary, I am new to both MVVM and SPA, not to mention modern OO Javascript. I come from ASP.NET MVC mainly.

Thanks in advance!

PS: I've read the three "A Day at the SPA" blog articles by Derick Bailey and the Getting Started SPA guide. I'm just looking for some guidance at this point. 
Petyo
Telerik team
 answered on 07 Feb 2014
1 answer
195 views
Hi, I created an index.html page with router and template loader as described here:
http://docs.telerik.com/kendo-ui/howto/load-templates-external-files

Now what I'm trying to do is to dynamically load the template data each time I navigate to a new url.

The first part of clicking on links and navigating with using the router works perfect. It even has a great caching mechanism so it won't load each template more than once. The question is what is the best practice to inject the server data into the template?

For example let's say that I'm looking at a homepage and I have a link to the customers page. Click on the link will switch view to the customers.html and will show the template page. Now I need to load all the customers. When and how do I do that? In the template page? I think that it would be better if the code that loads the customers will be in a separate js file that will load the data, populate the viewModel (am I right here?) and bind it to the page. Same questions when clicking on a specific user in order to edit it in a new popup - when and what is the best way to load the data?
Petyo
Telerik team
 answered on 07 Feb 2014
0 answers
75 views
Can anyone explain the invalid white space generated by the template binding.  It occurs in each <li> before the <table>
see http://jsfiddle.net/hSXL4/2/

Regards
Jaco

Jaco De Villiers
Top achievements
Rank 2
 asked on 07 Feb 2014
6 answers
235 views
I am trying to open a grid as the detail template inside a grid but it seems it is not opening is correct place. Please help. The detail steps with screenshot is the attached document.

The code to open the grid is as below

Grid Definition and related code
@(Html.Kendo().Grid().Name("grvInvSplit")
        .TableHtmlAttributes(new { style = "table-layout: fixed;" })
        .ClientDetailTemplateId("ViewGridItemDetails")
        .DataSource(dataSource => dataSource.Ajax()
                                            .Batch(false)
                                            .ServerOperation(false)
                                            .Read(...)
                                            .Create(..)
                                            .Update(..)
                                            .Model(model => model.Id(p => p.GridRowNum))
                                            .Model(model => model.Field(p => p.GridRowNum).DefaultValue(-1))
                                            .Events(events => events.RequestEnd("onGridRqstEnd")
                                                                    .Error("onGridError"))
                   )
        .Columns(cols =>
        {           
            ...
            ...
        })
        .EnableCustomBinding(false)
        .Selectable()
        .Pageable()
        .Resizable(resizing => resizing.Columns(true))
        .Editable(editing => editing.Mode(Kendo.Mvc.UI.GridEditMode.InLine)
                 .DisplayDeleteConfirmation(false)
                 )
        .Events(events => events.DataBound("onGridDataBound")
                                .Save("onGridSave")
                                .Edit("onGridEdit")
                                .Change("onGridChange")
                                .DetailExpand("gridViewChrgDetailExpand")  
               )
        )
         
 
<script id="ViewGridItemDetails" type="text/x-kendo-template">
    <div id="ViewGridItemDetailsRow_#= GridRowNum #">
    Loading ...
    </div>
</script>
 
<script>
gridViewChrgDetailExpand: function (e) {       
   $("#ViewGridItemDetailsRow_" + selectedGridRow.GridRowNum).html(<html>);
}
</script>

Please help to solve the issue.

regards,
Sanjay
Sanjay
Top achievements
Rank 1
 answered on 07 Feb 2014
1 answer
667 views
Using Kendo Grid in an MVC application. 

The primary model for the View (PlanViewModel) contains a property which is a foreign key to another entity (BuildingId) For instance, 

    public class PlanViewModel
    {
        
        public int PlanId { get; set; }
        public string PlanName { get; set; }
        public int BuildingId { get; set; }
        ...
}

The Building ID is to be populated by the selected row of a BuildingGrid on the View. 

So with the BuildingGrid, I'm using the .Selectable setting to invoke an onChange event.  How in the following event would I update the model.BuildingId 

    function onChange(arg) {
        var selected = $.map(this.select(), function (item) {
            return $(item).text();
        });
        
        /// UPDATE MODEL BuildingId here

    }


Thanks! 






GCS
Top achievements
Rank 1
 answered on 06 Feb 2014
5 answers
322 views

I am trying to understand how can provide sorting & filtering on a column of view model that was flattened.

VMAddress
addressid
street1
street2
countryid
CountryName
stateid
StateName
cityid
CityName

The Coulumns CountryName,StateName and CityName as flattened fro their respective table ( i.e Country.CountryName, State.StateName,City.CityName).

If i filter or sort on this columns nothing happens. since i don' have those fileds as column in the database.

How can shift the filter on the server to other columns ?
Daniel
Telerik team
 answered on 06 Feb 2014
8 answers
159 views
Hi, 
I have a little problem when the data is shown. 
I want a chart with the hours of service of a company, I have three fields, HOURS_SERVICE, TYPE_SERVICE, COMPANY.

The chart must show the hours of each type of service by company, I've tried this:
I attach two files: the first is the chart that I want and the second is the chart that's showing with Kendo

My View:
@model IEnumerable<SIS_CSC.ViewMoldels.HorasTrabajadasTecnicosViewModel>

<
div>
 
    <h2 align="centre"> REPORTE DE SERVICIOS POR EMPRESA</h2>
 
    @(Html.Kendo().Chart(Model)
    .Name("Chart")
    .Title("Gráfico de horas de servicio de los clientes por tipo de trabajo")
    .DataSource(datasource => datasource
        .Read(read => read.Action("LeerExt_GraficoServicio", "Consultas").Data("getParameter"))
        .Group(group => group.Add(model => model.TIPO_SERVICIO))
        )
        .CategoryAxis(axis => axis
             .Categories(model => model.EMPRESA)
             .Title("Cliente")                         
             .Labels(label => label.Rotation(-90))
             .MajorGridLines(major => major.Visible(false))                 
        )
       .SeriesDefaults(
            seriesDefaults => seriesDefaults.Column().Stack(true)
                )
        .Series(series => {
            series.Column(model => model.TOTAL_HORAS)
                .Name("");
        })
        .Legend(legend => legend
            .Position(ChartLegendPosition.Right)
        )
        .ValueAxis(axis => axis.Numeric()
            .Title("Horas de servicio")
            .Labels(labels => labels
                .Format("{0}")
                .Skip(1)
                .Step(1)
            )
        )
        .Tooltip(tooltip => tooltip
            .Visible(true)
            .Format("{0,00}")
            .Template("#= series.name #: #= value #")
        )
        )
</div>

<script type="text/javascript">
    function getParameter() {
        return {
            txtFechaInicio: $("#txtFechaInicio").val(),
            txtFechaFin: $("#txtFechaFin").val(),
        };
    }

    function BindChart() {
        $("#Chart").data("kendoChart").dataSource.read();
        $("#Chart").data("kendoChart").redraw();
        //$("#Chart").data("kendoChart").refresh();
    }
</script>
My Controller:
public ActionResult LeerExt_GraficoServicio(string txtFechaInicio, string txtFechaFin)
        {
            return Json(GetServiciosByFecha(txtFechaInicio, txtFechaFin));
        }
Misahael
Top achievements
Rank 1
 answered on 06 Feb 2014
1 answer
130 views
Using the guide at http://docs.telerik.com/kendo-ui/getting-started/mobile/icons#restyle-only-the-custom-icon I've added a custom mask icon using the latest recommended way to do it. Unfortunately my icons (glyphish pack) seem to be just a tiny bit too large for my taste and the background-size is having no effect when i try to change it.

km-root .km-pane .km-view .km-home-new {
    background-size: 90% 90%;
    -webkit-background-clip: border-box;
    background-color: white;
}
.km-home-new {
    -webkit-mask-box-image: url("images/53-house@2x.png");
    background-color: red;
}

I have tried as low as 10% 10% and it changes nothing.
Kiril Nikolov
Telerik team
 answered on 06 Feb 2014
0 answers
32 views
I've customized the save event ( do remote update), but I don't know how to switch to edit button after the data updated(still update button). thanks for any help。
海贼王
Top achievements
Rank 1
 asked on 06 Feb 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?