Telerik Forums
UI for ASP.NET MVC Forum
5 answers
115 views
I'm trying to use a grid using the server-side binding like in the documentation. But when I click on the header of a column to sort I get the following javascript exeption

Unhandled exception at line 28, column 11311 in http://localhost:64716/bundles/kendo?v=Mt_vnIDxltOGpsu7Y4JtLwq860FIgJ_8g1LouxzoGkE1
0x800a138f - JavaScript runtime error: Unable to get the property "0" a reference null or undefined.

From what I gather from the developer tools it is the  return this._data[i] that throw the exception because this.data is undefined.
Rosen
Telerik team
 answered on 28 Jul 2014
1 answer
87 views
Is there a way to always show the selectable options for a MutliSelectFor on page load?

I never want the options hidden, ever.
Georgi Krustev
Telerik team
 answered on 28 Jul 2014
2 answers
417 views
I have Implemented Kendo.Mvc.UI.ISchedulerEvent and added a few more custom properties of my own to the class.
I have also set editable to using a template id, Editable(Function(e) e.TemplateId("ScheduleEditTemplate")
 
Now if I access the custom properties of the class like ${CustomProperty}, it works fine, but if I access any of the implemented properties like ${Description}  I get an error such as "Title is undefined"
any ideas, thanks



Alan Mosley
Top achievements
Rank 1
 answered on 28 Jul 2014
4 answers
205 views
I have the following drop-down

@(
                        Html.Kendo().ComboBox()
                        .Name("products")
                        .HtmlAttributes(new { style = "width:250px" })
                        .DataTextField("ProductName")
                        .DataValueField("ProductID")
                        .AutoBind(false)
                        .DataSource(source => {
                        source.Read(read =>
                        {
                            read.Action("GetList", "Submission", new { elementId = Model.Elements[i].FieldId });
                        })
                        .ServerFiltering(false);
                        })
                    )
The action is hit and the elementId is pass as expected. Now i need to be able to pass the current form and the data. I try as:
@(
                        Html.Kendo().ComboBox()
                        .Name("products")
                        .HtmlAttributes(new { style = "width:250px" })
                        .DataTextField("ProductName")
                        .DataValueField("ProductID")
                        .AutoBind(false)
                        .DataSource(source => {
                        source.Read(read =>
                        {
                            read.Action("GetList", "Submission", new { elementId = Model.Elements[i].FieldId }).Data("GetForm");
                        })
                        .ServerFiltering(false);
                        })
                    )
where the GetForm is a javascript function:
function GetForm() {
    return $('#subform').serializeArray();
}
But using this i cant get to the action: JsonResult GetList(int? elementId,SubmissionElement model)

Any ideas how can i achieve the passing of the current data in the form to my controller?





Kiril Nikolov
Telerik team
 answered on 28 Jul 2014
2 answers
79 views
Hello all.

I would like to have a different way to display the days and times. But I have no idea how to do it or if it is even possible.

On horizontal axis there should be all  the resources e.g employees.
On the vertical axis I would like to have the next 120 hours.

Any ideas? Suggestions?

Kind regards
Bernd
Bernd
Top achievements
Rank 2
 answered on 28 Jul 2014
16 answers
3.6K+ views
Greetings,

I am getting a few asp.net mvc 4 minification errors.

I am using the following snippets in my bundling to allow minification while in release mode.

bundles.IgnoreList.Clear();
// FOR KENDO -Add back some of the default ignore list rules
bundles.IgnoreList.Ignore("*.intellisense.js");
bundles.IgnoreList.Ignore("*-vsdoc.js");
bundles.IgnoreList.Ignore("*.debug.js", OptimizationMode.WhenEnabled);
if (!HttpContext.Current.IsDebuggingEnabled)
     BundleTable.EnableOptimizations = true;

When I deploy to a staging server in release mode with the KendoUI version 2013.3.1119 I am receiving a handful of these listed below and my application fails to load:

/* Minification failed. Returning unminified contents.
(10,95812): run-time error CSS1030: Expected identifier, found '.'
(10,95829): run-time error CSS1031: Expected selector, found ')'
(10,95829): run-time error CSS1025: Expected comma or open brace, found ')'
(10,95866): run-time error CSS1030: Expected identifier, found '.'
(10,95883): run-time error CSS1031: Expected selector, found ')'
(10,95883): run-time error CSS1025: Expected comma or open brace, found ')'
(10,96027): run-time error CSS1030: Expected identifier, found '.'
...


Kamen Bundev
Telerik team
 answered on 28 Jul 2014
1 answer
231 views
Hi, 

I am using two kendo tree views in my screen. The trees are taking long to load.  Each of the tree has around 200 nodes with checkbox. I added .LoadOnDemand(true), but not of much help. 

I am populating treeviews models in C# and passing it to the razor views. I am attaching my treeview's razor files (CasTradeOrgnTreePartial.cshtml and CasTradeDestTreePartial.cshtml) and C# procedure (populate_tree_model_C#_procedure.cs) . 

Please advise, how to speed up the tree loading time.

Regards, 

Manoj
Alexander Popov
Telerik team
 answered on 28 Jul 2014
1 answer
439 views

Hi - I just have a list of strings to bind.

I get the list from splitting a comma separated list...

I want the list of selected values posted to the server:

​ var multiselections = Model.InformationIntakeGroupOption.Split(new char[] {','}).ToList();
 @(Html.Kendo().MultiSelectFor(model => model.InformationIntakeValue)
 .Placeholder("Click here to select opitons...")
 .BindTo(multiselections)
 .AutoClose(false)
 .Animation(false)
 )

All I get is the first selected value, not all selected values...

Any ideas?
Eric
Top achievements
Rank 2
 answered on 25 Jul 2014
1 answer
154 views
Been working on this for too long now. I have a detail grid where one of the columns is not editable by the user. It's value is calculated based on values in other fields/columns. If the user changes one of these, a stored proc is ran on the server that updates the calculated field. I have verified that the database is updated correctly. The problem is the grid is not refreshing/rebinding unless i force a datasource read (reload page, change pages in grid , etc.) . I know this is something silly on my part; maybe someone can point out my problem.

Here is my grid definition: 

@(Html.Kendo().Grid<CNX.Domain.Entities.CnxRailcar> ()
         .Name("ReceivedTrains_#=Id#")         
         .Editable(editable => editable.Mode(GridEditMode.InCell))         
         .Columns(columns =>
           {                   
               columns.Bound(o => o.Id).Visible(false);
               columns.Bound(o => o.CNX_TRAIN_GUID).Visible(false);
               columns.Bound(o => o.PERMIT_NUMBER).EditorTemplateName("_textEditor").Width(50);
               columns.Bound(o => o.OWNER_CODE).EditorTemplateName("_textEditor").Width(25);
               columns.Bound(o => o.OWNER_EQUIPMENT_NUMBER).Width(80).EditorTemplateName("_textEditor");
               columns.Bound(o => o.EQUIPMENT_NUMBER).Width(80).EditorTemplateName("_textEditor");
               columns.Bound(o => o.SEQUENCE_NUMBER).Width(75).EditorTemplateName("_numericTextEditor");
               columns.Bound(o => o.PILE).Width(75).EditorTemplateName("_PilesDropDown").Width(100);
               columns.Bound(o => o.CLASS).Width(75).EditorTemplateName("_classDropDown");
               columns.Bound(o => o.LOT).Width(75).EditorTemplateName("_textEditor"); 
               columns.Bound(o => o.COMMENTS).EditorTemplateName("_commentsDropDown").Width(100);
               columns.Bound(o => o.STATUS).EditorTemplateName("_railcarStatusDropDown").Width(100).Filterable(filterable => filterable
                                                                               .UI("statusFilter")
                                                                               .Extra(false)
                                                                               .Operators(operators => operators
                                                                                                       .ForString(str => str.Clear()
                                                                                                       .IsEqualTo("Is Equal To")
                                                                                                       .IsNotEqualTo("Is Not Equal To"))));              
           })
           .Events(ev => ev.Save("receivedRailcars_Save").DataBinding("loadToolBar(\'#=Id#\')").DataBound("colorDatabound").Cancel("colorCancel").Edit("colorEdit"))
           .DataSource(dataSource => dataSource.Ajax()
                                               .PageSize(10)
                                               .Read(read => read.Action("CnxRailcars" , "MenuTrain" , new { trainGuid = "#=Id#" } ).Type(HttpVerbs.Post))
                                               .Update(update => update.Action("CnxRailcarUpdate", "MenuTrain", Model).Type(HttpVerbs.Post)).Model(model => model.Id(o => o.Id)))
           .ToolBar(tb =>
               {
                   tb.Template("<table id='batchApply'><tr><td colspan='3' style='text-align : left ;'><input type='button' value='Add Railcar' id='addCar_#Id#' class='k-button' onclick='addCar(\"" + "#=Id#" + "\")'</td>" +
                       "<td><input type='button' value='Locomotive Details' id='viewLoco_#Id#' class='k-button' onclick='viewLoco(\"" + "#=Id#" + "\")'</td></tr>" +
   "<tr><td><label>Car Range</label></td><td><label>Select Class</label></td><td><label>Select Pile</label></td><td></td></tr>" +
   "<tr><td><table><tr><td><label style='text-align : right ;'>start</label></td><td style='text-align : left ; '><input id='carStart_#=Id#' /></td></tr>" +
   "<tr><td><label style='text-align : right ;'>end</label></td><td style='text-align : left ;'><input id='carEnd_#=Id#' /></td></tr></table><td><div id='detailClass_#=Id#' /></td>" +
   "<td><div id='detailPile_#=Id#' /></td><td><input type='button' value='Apply To Cars' id='applyLot_#=Id#' class='k-button' onclick='apply(\"" + "#=Id#" + "\")'/></td></tr></table>"
                       );
               })                                               
           .Pageable()
           .Sortable()           
           .Filterable(filterable => filterable.Extra(false))      
           .ToClientTemplate()
   )

Here is my saved event handler for the grid : 

function receivedRailcars_Save(e) {
          
       if (e.values.CnxComments != null) {
           e.model.set("COMMENTS" , e.values.CnxComments.CNX_COMMENT_DESCRIPTION) ;
       }
       else if (e.values.RailCarStatus != null) {
           e.model.set("STATUS", e.values.RailCarStatus.CNX_RAILCAR_STATUS_DESCRIPTION);
       }
       else if (e.values.CnxPiles != null) {
           e.model.set("PILE", e.values.CnxPiles.CNX_PILE_NUMBER);
       }
       else if (e.values.CnxClasses != null) {
           e.model.set("CLASS", e.values.CnxClasses.CNX_CLASS_NAME);
       }
       else {
           var myReflector = new reflector(e.values);
           var reflectorProperties = myReflector.getProperties();
           e.model.set(reflectorProperties[0], e.values[reflectorProperties[0]]);
       }
 
       e.sender.dataSource.sync();
   }

The line e.sender.dataSource.sync() forces the update action method to be called on the server. Here's that action method:

[HttpPost]
        public JsonResult CnxRailcarUpdate(CnxRailcar railCar, [DataSourceRequest] DataSourceRequest request)
        {           
            try
            {
                cnxRailcarRepository.Save(railCar); 
                cnxRailcarRepository.ApplyLots(railCar.CNX_TRAIN_GUID);  
            }
            catch (Exception e)
            {              
                Response.StatusCode = 550;
                Response.Write(e.Message);
            }
            return Json(cnxRailcarRepository.Railcars(railCar.CNX_TRAIN_GUID).Where(x => x.Id == railCar.Id).ToDataSourceResult(request));
        }

The repository's ApplyLots method just calls a stored proc on the database, and update the db context of the repository.

Any suggestions?




















Nikolay Rusev
Telerik team
 answered on 25 Jul 2014
7 answers
361 views
We have just downloaded the latest July release of Kndo wrappers for MVC . We are trying to test them side by side with the MVC extensions however we get the following error when building the project after adding reference to the Kendo dll

'SliderTickPlacement' is an ambiguous reference between 'Telerik.Web.Mvc.UI.SliderTickPlacement' and 'Kendo.Mvc.UI.SliderTickPlacement'

You do say that it is possible to use  Kendo  within the same project. Would appreciate clarification.
Many thanks
Ed
Top achievements
Rank 1
 answered on 25 Jul 2014
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?