Telerik Forums
Kendo UI for jQuery Forum
1 answer
103 views
Hello there.
I am using kendo ui with mvc. Its all running good, but I have a problem while integrating another jquery plugin.
I have my kendo running on Scripts/kendo/2013.1.514/jquery.min.js ( I guess), but my new sticky notes plugin of jquery required higher version of library. it is not working with jquery.min.js files.
Here is my script structure.


My master page looks like,
<head>
    <meta charset="utf-8" />
    <title>@ViewBag.Title - My ASP.NET MVC Application</title>
    <link href="~/favicon.ico" rel="shortcut icon" type="image/x-icon" />
    <meta name="viewport" content="width=device-width" />
  
    <link rel="stylesheet" href="~/Themes/style.css" />
    <script src="~/Scripts/jquery-1.7.1.min.js" type="text/javascript"></script>
    <script src="~/Scripts/jquery-ui-1.8.20.min.js" type="text/javascript"></script>
   
</head>
<body>
   @RenderBody()
</body>
<link href="@Url.Content("~/Content/kendo/2013.1.514/kendo.common.min.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/kendo/2013.1.514/kendo.metro.min.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/kendo/2013.1.514/kendo.dataviz.metro.min.css")" rel="stylesheet" type="text/css" />
     
     
    <script src="@Url.Content("~/Scripts/kendo/2013.1.514/jquery.min.js")"></script>
    <script src="@Url.Content("~/Scripts/kendo/2013.1.514/kendo.web.min.js")"></script>
    <script src="@Url.Content("~/Scripts/kendo/2013.1.514/kendo.aspnetmvc.min.js")"></script>
 
    @*USED FOR KENDO CHARTS*@
    <script src="@Url.Content("~/Scripts/kendo/2013.1.514/kendo.dataviz.min.js")"></script>
</html>
It is running fine for all the pages. on other pages I have kendo grid and many other stuffs, I also have the kendo menu.
My problem comes when I m trying to implement jQuery Sticky Notes on a particular page. here is the code

@model List<Sanwin.ViewModels.Collaboration.CollaborationNoteListModel>
@using Sanwin.Web;
@using Kendo.Mvc.UI
@{
   Layout = "~/Views/Shared/_ColumnsTwo.cshtml";
   // Layout = null;
}

@section left
{
    @Html.Partial("~/Views/Collaboration/_CollaborationNavigation.cshtml")
}
 
<link rel="stylesheet" href="@Url.Content("~/content/jQuery-Sticky-Notes/css/jquery.stickynotes.css")" type="text/css">
 
    @*<script src="~/Scripts/jquery-1.7.1.min.js" type="text/javascript"></script>*@
 @*<script src="~/Scripts/jquery-ui-1.8.20.min.js" type="text/javascript"></script>*@
<script type="text/javascript" src="@Url.Content("~/content/jQuery-Sticky-Notes/script/jquery.stickynotes.js")"></script>
 
<div class="product_body">
    <div class="account-page">
        <div class="page-title">
            <h1 style="float: left">My Notes
            </h1>
        </div>
        <div class="clear">
        </div>
        <div class="body">
         
            <div class="section-body" id="notes11" style="width:800px;height:600px;">
            </div>
        </div>
    </div>
   
</div>
<script>
  
</script>
 
<script type="text/javascript">
    // wait for the DOM to be loaded
    $(document).ready(function () {
        var options = {
            notes: [{
                "id": 1,
                "text": "Test Internet Explorer",
                "pos_x": 50,
                "pos_y": 50,
                "width": 200,
                "height": 200,
            }]
        }
        // $("#noteList").stickyNotes(options);
        $('#notes11').stickyNotes();
    });
</script>
I am getting error for sticky note saying 
Uncaught TypeError: Object [object Object] has no method 'stickyNotes'

If I set the layout to null, the sticky notes will work fine.
I understand its all due to jquery load sequence. can any one please help me out of this?

Dimo
Telerik team
 answered on 30 Aug 2013
15 answers
1.3K+ views
Hi,

I have an issue that I use a dropdown list for my foreignkey field like demo : http://demos.kendoui.com/web/grid/foreignkeycolumn.html

The difference is that the foreignkey field in my model which can be null some time if it is not related to anyone else. Then the issue for me is when I try to editRow with this foreignkey field's original value is null,  and I want to change to another value, this field will always get the value '[object object]'. I don't know why.

See the floor field in the following code:

<script>
    $(document).ready(function() {
        var template = kendo.template($("#detail_template").html());

        function show_menu_details(menuObj) {
            var tg = $("#details");
            tg.fadeOut(function(){
                tg.html(template(menuObj));
                tw = tg.find(".k-window");
                
                
                tw.css({width:tg.innerWidth()-30, height:tg.innerHeight()-55, "margin-top": 20, "margin-left":15});
            });
            tg.fadeIn();
        }
        
        $("#horizontal").kendoSplitter({
            panes: [{collapsible: true, size: "180px"},
                    { collapsible: true} ],
            height: 690
        });
        
        function onChange(e){
            e.preventDefault();
            selectedObj = this.dataSource.getByUid(this.select().data('uid'))
            //console.log(selectedObj);//(this.dataSource.data());
            show_menu_details(selectedObj);
        }
        
        var statuses = [
            {value:'', text:'--'},
            {value:'Available', text:'Available'},
            {value:'Locked', text:'Locked'},
            {value:'Reserved', text:'Reserved'},
            {value:'Occupied', text:'Occupied'}];
        var floors = new Array();
        floors[0]={text:'--',value:''};
        _DS_Floor.fetch(function(data){
            $.each(data.items,function(index,obj){
                floors[index+1] = {text: obj.name, value: obj.id};
            });
            
            var grid = $("#list").kendoGrid({
                dataSource: _DS_Room,
                selectable: "row",
                filterable: true,
                columnMenu: true,
                pageable: {refresh:true},
                editable: {mode:"popup",confirmation:"Sure to delete?"},
                height: 688,
                scrollable: {
                    virtual: true
                },
                sortable: true,
                toolbar: kendo.template($("#toolbar_template").html()), 
                columns: [//{field:'id',title:' ',width:40,template: '<input type="checkbox" id="#= id #" />'},
                          {field:'name',title:'Name'},
                          {field:'floor',title:'Floor',values:floors},
                          {field:'position',title:'Position'},
                          {field:'status',title:'Status',width:80,values:statuses}],//_Columns_Menu,//{ command: ['edit','destroy'], title: "", width: "200px" }
                //change: onChange
            });
            
            grid.find("#btn-add").click(function(e){
                e.preventDefault();
                grid.data("kendoGrid").addRow();
            });
            
            grid.find("#btn-save").click(function(e){
                e.preventDefault();
                grid.data("kendoGrid").saveChanges();//editRow(grid.data("kendoGrid").select());
            });
            
            grid.find("#btn-remove").click(function(e){
                e.preventDefault();
                grid.data("kendoGrid").removeRow(grid.data("kendoGrid").select());
            });
            
            grid.find("#btn-cancel").click(function(e){
                e.preventDefault();
                grid.data("kendoGrid").cancelChanges();//removeRow(grid.data("kendoGrid").select());
            });
            
        });
        
    });
</script>

Thanks.
--
Vladimir Iliev
Telerik team
 answered on 30 Aug 2013
5 answers
144 views
We are using the ASP.NET MVC wrappers for KendoUI Mobile.

Is it possible to have a non-fixed footer for my Views? I tried setting the .Footer() of our MobileLayout, but of course, that fixes the footer to the bottom of the screen.

But what we want is just a simple blurb at the bottom of each View, but it shouldn't be fixed, since the info shouldn't be visible at all times.

I also tried hooking into the "BeforeShow" event of each View to an appendBodyFooter(e) function, which would add a simple <div> element to the $(e.view.element), but for whatever reason, this new div also got stuck to the bottom of the screen! I couldn't find any CSS that was causing the new div to stick, so I'm guessing Kendo must have done it via JS somehow.

Is there any way to have a simple footer at the bottom of each View that is not fixed on the screen?
Kiril Nikolov
Telerik team
 answered on 30 Aug 2013
1 answer
87 views
This is a fairly minor issue, but it's something a client noticed, so I wanted to mention it here. In Chrome for Desktop if I zoom the browser out (CTRL+ -) and then go to insert a table in the editor control, the view is jumbled (see attachment).
Dimo
Telerik team
 answered on 30 Aug 2013
3 answers
3.4K+ views
How do I tell a grid (k-grid) not to use a 100% width? 
Dimo
Telerik team
 answered on 30 Aug 2013
1 answer
151 views
Hello,

I have a Kendo().Window() in my _Layout where i use the .LoadContentFrom("Method","Controller") But if the window can't get to the method due to not logged in, i get a infinite loop of script load at the login page since the KendoUiwindow is trying to access the method. Is there a way to set the timeout on the LoadContentFrom() or something?

Petur Subev
Telerik team
 answered on 30 Aug 2013
1 answer
108 views
Is it possible to update a listview by just using HTML, instead of the dataSource (which I think is a very inefficient method)? For instance, if I had a ul called "output," could I just update that from HTML fetched via AJAX via jQuery.html()?

This kind of worked before, but sometimes the listview wasn't refreshing.  Please add something like jQuery mobile's listview.refresh().

Also, when I switched to the flat listview as opposed to native, it updated, but I got this Javascript error:

Uncaught SyntaxError: Unexpected string
(anonymous function) st.extend.globalEval st.fn.extend.domManip st.fn.extend.append S.extend._createRemoteView
(anonymous function) f p.fireWith r r





Alexander Valchev
Telerik team
 answered on 30 Aug 2013
1 answer
150 views

Here is my code:
@(Html.Kendo().Grid(Model.Available).Name("s").DataSource(d => d.Ajax()).Filterable())
or
@(Html.Kendo().Grid().Name("s").DataSource(d => d.Ajax()[read data ...]).Filterable())

The grid displays information fine but it does not filter when I use the funnel filter icon or when I add my own custom filter. 
I am sure this is straight forward but I can't find the answer. 
jwize
Top achievements
Rank 1
 answered on 30 Aug 2013
4 answers
56 views
Hello KendoUI Team,

I'm about to start work a project for deployment to the Tizen platform (tablet and smartphone). I did a search for "Tizen" in the forums but found no references to it.

Has the KendoUI Team looked into Tizen and/or tested KendoUI Complete for it? Any "gotchas" to watch out for vis-a-vis the use of KendoUI Complete for Tizen?

Will appreciate any definitive response on this.

~Oscar
Kamen Bundev
Telerik team
 answered on 30 Aug 2013
6 answers
147 views
I tried to call the update and delete methods and always enters the created.
it can be?
<script>
    $(function () {
        $("#scheduler").kendoScheduler({
            date: new Date("2013/1/1"),
            startTime: new Date("2013/1/1 07:00 AM"),
            height: 600,
            views: [
            "day",
                { type: "month", selected: true },
                "month",
                "agenda"
            ],
            timezone: "Etc/UTC",
            //editable: { template: kendo.template($("#schedulerTemplate").html()) },
 
            dataSource: {
                batch: true,
                transport: {
                    read: {
                        url: "/Home/CalendarioCargar",
                        dataType: "jsonp"
                    },
                    update: {
                        url: "/Home/CalendarioUpdate",
                        dataType: "json"
                    },
                    create: {
                        url: "/Home/CalendarioAdd",
                        dataType: "json"
                    },
                    destroy: {
                        url: "/Home/CalendarioRemove",
                        dataType: "jsonp",
                         
                    },
                    parameterMap: function (options, operation) {
                        if (operation !== "read" && options.models) {
                            return { models: kendo.stringify(options.models) };
                        }
                    }
                },
                
                schema: {
                    model: {
                        id: "TaskID",
                        fields: {
                            taskId: { from: "TaskID", type: "number" },
                            title: { from: "Title", defaultValue: "No title", validation: { required: true } },
                            start: { type: "date", from: "FechaIni" },
                            end: { type: "date", from: "End" },
                            startTimezone: { from: "StartTimezone" },
                            endTimezone: { from: "EndTimezone" },
                            description: { from: "Description" },
                            recurrenceId: { from: "RecurrenceID" },
                            recurrenceRule: { from: "RecurrenceRule" },
                            recurrenceException: { from: "RecurrenceException" },
                            ownerId: { from: "OwnerID", defaultValue: 1 },
                            isAllDay: { type: "boolean", from: "IsAllDay" }
                        }
                    }
                },
                filter: {
                    logic: "or",
                    filters: [
                        { field: "ownerId", operator: "eq", value: 1 },
                        { field: "ownerId", operator: "eq", value: 2 }
                    ]
                }
            },
            resources: [
                {
                    field: "ownerId",
                    title: "Owner",
                    dataSource: [
                        { text: "Alex", value: 1, color: "#f8a398" },
                        { text: "Bob", value: 2, color: "#51a0ed" },
                        { text: "Charlie", value: 3, color: "#56ca85" }
                    ]
                }
            ]
        });
 
        $("#people :checkbox").change(function (e) {
            var checked = $.map($("#people :checked"), function (checkbox) {
                return parseInt($(checkbox).val());
            });
 
            var filter = {
                logic: "or",
                filters: $.map(checked, function (value) {
                    return {
                        operator: "eq",
                        field: "ownerId",
                        value: value
                    };
                })
            };
 
            var scheduler = $("#scheduler").data("kendoScheduler");
 
            scheduler.dataSource.filter(filter);
        });
    });
</script>
Rosen
Telerik team
 answered on 30 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?