Telerik Forums
UI for ASP.NET MVC Forum
1 answer
194 views
Hello Kendo UI Team,

I'm trying to add and select a new item to a treeview with remote datasource. This works as long as the branch of the tree is already loaded. If the branch is not loaded, the append-method returns null as documented. I tried to add a success callback method but it seems as if it is never called.

function createNewItem() {
    var tree = $("#dvTree").data("kendoTreeView");
    var selected = tree.dataItem(tree.select());
    var newnode = { text: '<new>', type:itemtype };
    newelement = tree.append(newnode, $(tree.select()), function () { alert("success"); });
   
    console.log(newelement);
 
    if (newelement) {
        tree.select(newelement);
        tree.trigger("select", { node: newelement });
    }
}
Am I trying a wrong approach here? Kendo UI Version is 2013.2.716.

Thanks in advance.
Daniel
Telerik team
 answered on 21 Aug 2013
6 answers
337 views
when clicking on a event in the schedule, it opens a window, how can we edit that window, or replace it with another,
 thanks.
Alan Mosley
Top achievements
Rank 1
 answered on 21 Aug 2013
1 answer
829 views
How to click kendo grid bound column to open a new window?
I want the command text be the bound column data. click the data cell to open a new window.

ie how to make the text "bounddata" to show the grid bound column data, for example if its' a data filed , I want the date to show in the cell, click the cell link to pop up a new window.

  columns.Command(command => command.Custom("ViewDetails").Text(bounddata)Click("showDetails"));


ie, for the example   http://demos.kendoui.com/web/grid/custom-command.html,

I like to open the detail window by clicking the Title link instead of click "View Detail".
How to do this? Can you provide detail sample code?


Thanks!


Nikolay Rusev
Telerik team
 answered on 21 Aug 2013
2 answers
94 views
I have what I consider the basics of kendo scheduler installed and it doesn't display correctly. I tried pasting the code from the kendo scheduler basic demo and experienced the same issues. Attached is a screenshot of what I see in Chrome. Below is a minimal page.
<!DOCTYPE html>
<head>
    <title></title>
    <link href="Content/kendo/kendo.common.min.css" rel="stylesheet" />
    <link href="Content/kendo/kendo.default.min.css" rel="stylesheet" />
    <script src="Scripts/jquery.min.js"></script>
    <script src="Scripts/kendo.all.min.js"></script>
</head>
<body>
    <div class="k-content">
        <div id="mydiv"></div>
    </div>
    <script>
        $(function () {
            $("#mydiv").kendoScheduler({
                height: 600
            });
        });
    </script>
</body>
</html>
Robert Murdoch
Top achievements
Rank 1
 answered on 20 Aug 2013
4 answers
309 views
I am using the latest internal build (Kendo UI Complete v2013.2.814) of KendoUI and have noticed if I return empty lists to a dropdown the OptionLabel is no longer rendering correctly.

Example Usage:

@(Html.Kendo().DropDownListFor(model => model.EmploymentId)
                      .OptionLabel("* Not Selected")
                      .DataTextField("Name")
                      .DataValueField("Id")
                      .BindTo(Model.Employments)
                      .Events(e => e.Select("EmploymentSelected")))
Nick
Top achievements
Rank 1
 answered on 20 Aug 2013
1 answer
353 views
Hi,
I am following the example 
var crudServiceBaseUrl = "http://demos.kendoui.com/service",
dataSource = new kendo.data.DataSource({
transport: {
read: {
url: crudServiceBaseUrl + "/Products",
dataType: "jsonp"
},
update: {
url: crudServiceBaseUrl + "/Products/Update",
dataType: "jsonp"
},

However, when I am using my Web API address for update, it shows "Request Method:GET Status Code:405 Method Not Allowed". My Web api Update method is a HttpPost method. Any suggestions please??

-Nahid
Vladimir Iliev
Telerik team
 answered on 20 Aug 2013
1 answer
329 views
I am relatively new to MVC and web programming in general but have used almost all the other Telerik controls (Forms, WPF, Silverlight). I downloaded and installed what I believe to be the Q2 2013 Kendo MVC controls. All of the documentation and examples use Html.Kendo()... But all I can find are Html.Telerik()... This would not be a problem except the documentation and demos do NOT match the api I appear to have. For example I am working with the Grid control and there is no OnChange event like in the demos and documentation but there are OnRowSelect and OnRowSelected events which are not documented.

Am I missing something?

Thanks
Dave Goughnour
Kiril Nikolov
Telerik team
 answered on 20 Aug 2013
1 answer
150 views

Hello Team, 

There is filter menu which get displayed when you click filter icon. Have added the code to display the same when you hit enter or space bar key . Below is the piece of code


Now once i am done i want to move the focus the tab on the clear filter icon and move to the next element . I am not able to do this. even i tried to set the focus. 

Is it possible to do ?

  $('.t-icon.t-filter').each(function () {
        $(this).attr('tabindex', '0')
        $(this).attr('title', 'Edit Filter')

        $(this).live('keydown', function (e) {
            var keyCode = e.keyCode || e.which;
            if (keyCode == 13 | keyCode == 32) {
                $(this).click();                     // show the filter pop up on enter or spacebar

                
            }

        });
    });
Daniel
Telerik team
 answered on 20 Aug 2013
4 answers
150 views
Hi

I'm trialling at the moment but i'm having a problem with the grid control.

I get the intial grid up with data to begin with but when i try to page or sort etc internet explorers asks whether I want to download the response and Firefox just displays the raw json data in a page.


I was wondering if anyone knew where I was going wrong with this one?
Here's the code:

private

IEnumerable<ReqAssess> GetRequests()

 {

 

var reqassess = reqAssessService.GetReqAssess();

return reqassess;

}


public

ActionResult Products_Read([DataSourceRequest] DataSourceRequest request)

 

{

 

return Json(GetRequests().ToDataSourceResult(request), JsonRequestBehavior.AllowGet);

}


@(Html.Kendo().Grid(Model)

.Name(

 

"Grid")

.Columns(columns =>

{

columns.Bound(p => p.ReqId).Width(100).Groupable(

 

false).Title("Request ID").ClientTemplate(

"# if (Urgent == \"Y\") { #" +

 "<div style=\"background-color: Red;\">#: ReqId #</div>" +

 "# } else { #" +

 "#: ReqId #" +

 "# } #"

 );

 columns.Bound(p => p.CompId).Title(

 

"Company ID").Width(110);

 columns.Bound(p => p.Facid).Title("Facility ID").Width(110);

 columns.Bound(p => p.Mtrlcode).Title("Code").Width(90);

 columns.Bound(p => p.Tradename).Title("Tradename").Width(170);

 columns.Bound(p => p.Requested).Format("{0:dd/MM/yyyy:hh:mm:ss}").Width(110); ;

 columns.Bound(p => p.DateDue).Format("{0:dd/MM/yyyy}").Title("Date due").Width(100); ;

 columns.Bound(p => p.Completed).Format("{0:dd/MM/yyyy}").Title("Completed").Width(100); ;

 columns.Bound(p => p.Status).Width(150);

 columns.Bound(p => p.AssignedTo).Width(100);

 

})

 .ClientDetailTemplateId(

 

"employeesTemplate")

 .Groupable()

 .Pageable()

 .Sortable()

 .Scrollable()

 .Filterable()

 .Selectable()

 .Pageable(pager => pager

 .Refresh(

 

true)

 .PageSizes(new int[4] {10, 20, 30, 40}))

 .ColumnMenu()

.Resizable(resize => resize.Columns(true))

 .Reorderable(reorder => reorder.Columns(true))

 .DataSource(dataSource => dataSource

 .Ajax()

 .Read(read => read.Action(

 

"Products_Read", "InTray"))

 .PageSize(30)

 ))

Mario
Top achievements
Rank 1
 answered on 19 Aug 2013
1 answer
209 views
I'm biding a treeview to a remote data and at this point the data is displayed correctly. The problem: when I change the data in the database and refresh my page, the treeview doesn't reflect the new data. It seems that the treeview is not calling the json action anymore after the first load.

I tried to work with LoadOnDemand and several other methods, but nothing worked so far. I need to refresh the data because when users drag and drop the nodes, the treeview will be updated in the database.

** Code is attached. I also just noticed that it works on Chrome but not IE 10. Thank you for any help.

I'm following this demo code: http://demos.kendoui.com/web/treeview/remote-data.html

This is my json action:

public JsonResult Categories(int? id)
{

var categories = from e in db.Categories
where (id.HasValue ? e.ParentCategoryID == id : e.ParentCategoryID == 1)
orderby(e.OrderNumber)
select new
{
id = e.CategoryID,
Name = e.CategoryNames.FirstOrDefault().Name,
ParentId = e.ParentCategoryID,
hasChildren = db.Categories.Where(j => j.ParentCategoryID == e.CategoryID).Any()
}
;

return Json(categories, JsonRequestBehavior.AllowGet);
}

This is my treeview code:

Html.Kendo().TreeView()
.Name("treeviewcategories")
.DataTextField("Name")
.DataSource(dataSource => dataSource
.Read(read => read
.Action("Categories", "Settings")
)
)
.Events(events => events
.Select("onSelect")
.DragEnd("onDragEnd")
.Expand("onExpand")
)
.DragAndDrop(true) 
Development Team
Top achievements
Rank 1
 answered on 19 Aug 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?