Telerik Forums
UI for ASP.NET MVC Forum
3 answers
292 views
Please reply to: v-daughw-oxf@ae.com

I cannot get the requestEnd event to fire at all with Kendo MVC build 2013.1.319.340 . WHY???????

< script>

//can't get this to fire to display success/fail msg
function onRequestEnd(e) {

debugger

//Check request type
if (e.type == "create" || e.type == "update") {
//check for errors in the response
if (e.response == null || e.response.Errors == null) {
$('#PivotGrid').data().kendoGrid.dataSource.read();
alert("Update Successful");
}
else {
alert("Update Failed");
}
}
}






< /script>


< div align="center">

@(Html.Kendo().Grid<PivotRow>()
.Name("PivotGrid")
.HtmlAttributes(new { align = "center", style = "height:600px; width:75%" })
.Scrollable()
.Sortable()
.Navigatable()
.Columns(columns =>
{
columns.Bound(c => c.us_price).Width(90).Title("US Price");
columns.Bound(c => c.us_base_pricepoint).Width(90).Title("US Base Price").Hidden();
columns.Bound(c => c.canada_price).Width(90).Title("Canada Price");
columns.Bound(c => c.mexico_price).Width(90).Title("Mexico Price");
columns.Bound(c => c.what_system).Width(100).Title("What System").Hidden();
//columns.Bound(c => c.what_system).Width(90).EditorTemplateName("_DDL_BM");
columns.Command(command => command.Destroy()).Width(50);

})
.Editable(editing => editing.Mode(GridEditMode.InCell))
// Command configuration
.ToolBar(toolbar =>
{
toolbar.Create();
toolbar.Save();
})
.Events(e => e.SaveChanges("saveChanges"))
.DataSource(dataSource => dataSource
.Ajax()
.Batch(true)
// Specify property that is the unique identifier of the model
.Model(model => model.Id(c => c.us_base_pricepoint))
.Model(model =>
{
model.Field(c => c.what_system).DefaultValue("BM");
})
.Events(events =>
{
events.RequestEnd("onRequestEnd"); //can't get this to fire!
events.Error("error");
})
.Create(create => create.Action("PricePoint_Create", "AE_IB_LOOKUP_VAL"))
.Read(read => read.Action("PricePoint_Read", "AE_IB_LOOKUP_VAL"))
.Update(update => update.Action("PricePoint_Update", "AE_IB_LOOKUP_VAL"))
.Destroy(destroy => destroy.Action("PricePoint_Destroy", "AE_IB_LOOKUP_VAL"))
)
)
Vladimir Iliev
Telerik team
 answered on 24 May 2013
1 answer
128 views
How can I set the height of a RadialGauge using the server-side wrapper if it's not exposed?
@(
    Html.Kendo().RadialGauge()
        .Name("patientDocumentMatchThresholdGauge")
        .Pointer(pointer => pointer.Value((double)Model.PatientDocumentMatchThreshold * 100))
        .Scale(scale => scale
            .EndAngle(180)
            .MajorUnit(10)
            .Max(100)
            .Min(0)
            .MinorUnit(1)
            .StartAngle(0)
            .Ranges(ranges => {
                ranges.Add().From(0).To(90).Color("#f00");
                ranges.Add().From(90).To(95).Color("#ffa500");
                ranges.Add().From(95).To(100).Color("#0c0");
            }
        )
    )
)
Petur Subev
Telerik team
 answered on 23 May 2013
2 answers
93 views
I have a couple of dropdowns that are setup to cascade:
01.@(Html.Kendo().DropDownListFor(model => model.FixedMovementType)
02.                      .OptionLabel("* Not Selected")
03.                      .DataTextField("Name")
04.                      .DataValueField("Id")
05.                      .BindTo(Model.FixedMovementTypes))
06.                @Html.ValidationMessageFor(model => model.FixedMovementType, "", new {@class = "alert-error"})
07.                @(Html.Kendo().DropDownListFor(model => model.Location)
08.                    .OptionLabel("* Not Selected")
09.                    .DataTextField("Name")
10.                    .DataValueField("Id")
11.                    .DataSource(source => source.Read(read => read.Action("GetLocationsRead", "FixedMovement").Data("FilterLocation")).ServerFiltering(true))
12.                    .AutoBind(false)
13.                    .CascadeFrom("FixedMovementType"))

Example data for the first dropdown (being cascaded from):
1.{
2.Id = 0,
3.Name = "Employment"
4.},
5.{
6.Id = 1,
7.Name = "Store"
8.}
Everything is working just fine except when Employment is selected in the first dropdown this does not fire cascading.  Is it intended when the value of the dropdown is = 0 that cascading won't fire?  This seems quite silly to me because when there is nothing selected .value() returns an empty string.
Georgi Krustev
Telerik team
 answered on 23 May 2013
5 answers
381 views
Hi,

I'm new to HTML 5.  I started with the cascading dropdownlist with ASP.NET MVC example and the .cshtml and .cs files.  However, the first dropdownlist is not populating.  I watched the steps in the debugger but it is not hitting the script.  What am I missing?  How do I associate the .cs file with the .cshtml.  I made some minor change in the .cs file to display hard coded data but the methods are not being called.

Any help would be greatly appreciated.
Dimiter Madjarov
Telerik team
 answered on 23 May 2013
1 answer
65 views
When i create a window the the below code it assigns the "error" handler to the "refresh" handler in JS. I'm guessing this is a bug.

Html.Kendo().Window()
        .Name("createDocWin")
        .Modal(true)
        .Draggable(false)
        .Height(300)
        .Resizable(r => r.Enabled(false))
        .Events(e => e.Error("errorCreatingDoc"))
<script>
    jQuery(function(){jQuery("#createDocWin").kendoWindow({"refresh":errorCreatingDoc,"modal":true,"iframe":false,"draggable":false,"title":"Created Document","resizable":false,"content":null,"width":300,"height":300,"actions":["Close"]});});
</script>
Dimiter Madjarov
Telerik team
 answered on 23 May 2013
1 answer
72 views
Windows Azure needs the "Transient Fault Handling Application Block" integrated for database queries (basically a retry logic) - or wait for EF6 which will support it transparently.

Are there any existing best practices on how to use it with KendoUI MVC?

ATM the Kendo Grid gets an IQueryable expression through a ViewModel property as it will extend the query with paging/grouping/etc. Unfortunately it does not compatible with the above fault handling block, could you please suggest a solution/workaround?
Petur Subev
Telerik team
 answered on 23 May 2013
1 answer
934 views
In the Kendo Grid component we are handling both the dataSource RequestEnd event and Error events. On out production site, for IE and Chrome (but not Firefox) , the RequestEnd event is coming back with a "undefined" argument.type property (we are relying on the "update"  type to trigger certain events). It turns out the at the same time in the Error event handler there is an error happening with the message "Unexpected end of input". So this brings up three questions:

  1. What could be causing the "Unexpected end of input" error in Chrome/IE? Has this been reported before?
  2. Why would a dataSource.Error event cause the dataSource.requestEnd event not to contain the argument type property (even though the argument itself is not null) ? 
  3. And is there a way to know, in these cases, if it is an update  taking place?
We are using the latest SP build, jQuery 1.9 with jQuery migration script. Again it works fine in Firefox
Atanas Korchev
Telerik team
 answered on 23 May 2013
5 answers
97 views
I got this error (see attachement).

The view :
    @(Html.Kendo().Grid<MesFormations.Models.EmployeGridView>()
        .Name("grid")
        .Columns(columns =>
        {
            columns.Bound(e => e.NomEmploye).Width(110);
            columns.Bound(e => e.CourrielEmploye).Width(110);
            columns.Bound(e => e.Telephone).Width(110);
            columns.Bound(e => e.PosteTelephone);          
        })              
        .Sortable()
        .Pageable()
        .Scrollable()
        .ClientDetailTemplateId("template")
        .HtmlAttributes(new { style = "height:430px;" })
        .DataSource(dataSource => dataSource
            .Ajax()
            .PageSize(6)
            .Read(read => read.Action("HierarchyBinding_Employees", "Employe"))           
        )       
        .Events(events => events.DataBound("dataBound"))
)
 
 
 
<script id="template" type="text/kendo-tmpl">
    @(Html.Kendo().Grid<MesFormations.Models.FormationEmployeGridView>()
            .Name("grid_#=NoEmploye#")
            .Columns(columns =>
            {
                columns.Bound(o => o.NoFormation).Width(70);
                columns.Bound(o => o.DateFormation).Width(110);
                columns.Bound(o => o.DateModification);
                columns.Bound(o => o.Remarques).Width(200);
            })
            .DataSource(dataSource => dataSource
                .Ajax()
                .PageSize(5)
                .Read(read => read.Action("HierarchyBinding_Orders", "Employe", new { employeeID = "#=NoEmploye#" }))
            )
            .Pageable()
            .Sortable()
            .ToClientTemplate()
    )
</script>
<script>
    function dataBound() {
        this.expandRow(this.tbody.find("tr.k-master-row").first());
    }
</script>
The controller :

public ActionResult HierarchyBinding_Employees([DataSourceRequest] DataSourceRequest request)
 {
     return Json(GetEmployees().ToDataSourceResult(request));
 }
 
 public ActionResult HierarchyBinding_Orders(int employeeID, [DataSourceRequest] DataSourceRequest request)
 {
     return Json(GetOrders()
         .Where(order => order.NoEmploye == employeeID)
         .ToDataSourceResult(request));
 }
 
 private static IEnumerable<FormationEmployeGridView> GetOrders()
 {
     var northwind = new FormationContext();
 
     //var loadOptions = new DataLoadOptions();
 
     //loadOptions.LoadWith<Order>(o => o.Customer);
     //northwind.LoadOptions = loadOptions;
 
     return northwind.FormationEmploye.Select(order => new FormationEmployeGridView
     {
         NoFormationEmploye = order.NoFormationEmploye,
         NoEmploye = order.NoEmploye,
         NoFormation = order.NoFormation,
         DateFormation = order.DateFormation,
         Remarques = order.Remarques,
         DateModification = order.DateModification
     });
 }
 
 
 private static IEnumerable<EmployeGridView> GetEmployees()
 {
     var northwind = new FormationContext();
 
     return northwind.Employes.Select(employee => new EmployeGridView
     {
         NoEmploye = employee.NoEmploye,
         PrenomEmploye = employee.PrenomEmploye,
         NomEmploye = employee.NomEmploye,
         CourrielEmploye = employee.CourrielEmploye,
         Telephone = employee.Telephone,
         PosteTelephone = employee.PosteTelephone
     });
 }



And I don't have those line web.config
<httpRuntime targetFramework="4.5" encoderType="System.Web.Security.AntiXss.AntiXssEncoder, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
Dimiter Madjarov
Telerik team
 answered on 22 May 2013
1 answer
148 views
I have a Kendo Window which I am dynamically loading and showing when the user clicks on a "details" link in a grid. The dynamic content contains a Kendo Tooltip. Each time the Kendo Window is loaded and shown, new HTML markup is generated for the tooltip outside of the DIV that contains the window's content. This results in multiple copies of the same tooltip markup in the DOM. 

Is there any way I can tell the tooltip to render inside of a specific region of the page, so it would be overwritten when the KendoWindow is filled with new content?
Rosen
Telerik team
 answered on 22 May 2013
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?