Telerik Forums
Kendo UI for jQuery Forum
3 answers
89 views
When moving items between grids, if i bring back item that has been previously removed it is not working. However, if i set the _destroyed to null it is working but later a null exception is thrown. Is there a more intelligent way of handling this situation.

Thanks
Svetlin
Top achievements
Rank 1
 answered on 11 Nov 2013
1 answer
390 views
Hi all,

For a large data, i use a model with a little fields for display. In case, customer click one row in grid and choose update button the edit popup will show up. In this popup dialog, i want to use another model with full fields (from database) to change information but i dont know how and where to swith to new model for edit popup.

Please, help me to solve this problem.

Regards,
Lee
Atanas Korchev
Telerik team
 answered on 11 Nov 2013
1 answer
87 views
In using jsut the basic method of building html (ul/li) and then setting:

$(

 

"#treeview").kendoTreeView({
checkboxes: {checkChildren:
true},
});

Is there a way via Html tags to set what items have a checkbox or not?

 

Dimiter Madjarov
Telerik team
 answered on 11 Nov 2013
1 answer
128 views
Hi, 

we are using the declarative way to create the view. I found a problem that the data binding is not working on the grid when I want to use the server grouping on the underlying data set. When we are using client-side grouping, it works without problem.

It looks like that when I am using server side grouping, data-binding crashes with an error, that the method get (which is normally on an ObservableObject instance) is not defined on the "items" element of the group (download the example and run it).

I am sending simple example. In this example there are two datasets. One that represents the server-side grouped data and the second that is used for client-side grouping (is commented out but you can uncomment it and verify that it works fine).

The example is using kendo.all.js file but I removed that file because of licence. If You would like to try it out, please, add there this script (should be no problem).

Could You, please, point me to the problem?

Thank You for Your time.

Sincerely,


Lukas Vyhlidka
HP
Alexander Valchev
Telerik team
 answered on 11 Nov 2013
2 answers
823 views
Hello,

I am trying to add a totals row to my grid, and I've boiled my problem down to a very simple jsfiddle:

http://jsfiddle.net/2efYE/20/

Note that there is an "Uncaught ReferenceError: sum is not defined" error.

If you replace "sum" in the footerTemplate with a static value (e.g. "100") then it works fine. I must be missing something very basic, but after spending a lot of time staring at the grid aggregates demo and experimenting, I still can't seem to figure it out. Maybe something unique to MVVM? Maybe you can't do aggregates without also grouping (although I tried it with groups, too)?

Thanks in advance for the help,
--Dan
Dan
Top achievements
Rank 1
 answered on 11 Nov 2013
3 answers
63 views
Attached is what 2 ajax-fed schedulers on the same page look like...??

sitefinitysteve
Top achievements
Rank 2
Iron
Iron
Veteran
 answered on 11 Nov 2013
12 answers
1.8K+ views
 
Hi

I have a kendo grid with sorting enabled.  I am trying to sort on a column with a field called "Document_Category"

In the model Document_Category is an object that is comprised of 2 properties: Document_Category_Name (string) and  Document_Category_ID (int).  I have this field setup as an object this way so I can bind the id to the selected item of a dropdown list in the editor template

How can I can I configure the grid to sort this column by the Document_Category_Name property of the object that the field is bound to.

Is this possible? If not is there another way to bind to a dropdown list?

My code is below; thanks


$("#grid").kendoGrid({

             columns: [
                    { title: " ", template: "#= doclink(data) #", width: 31 },


                    { field: "Document_Category", title: "Category", width: "150px", editor: categoryDropDownEditor, template: "#=Document_Category.Document_Category_Name#" },
                    { field: "DOCUMENT_TITLE", title: "Title" },
                    { field: "DOCUMENT_FILE_NAME", title: "File Name" },
                    { field: "DOCUMENT_DESCRIPTION", title: "Description" },

                    { field: "DOCUMENT_FILE_SIZE", title: "File Size" },
                    { field: "tags", title: "Tags" },
                    { field: "DOCUMENT_CREATION_DATE", title: "Creation Date", format: "{0:dd-MMM-yyyy}" },

                    { command: "destroy", title: "Delete", width: "110px" }
                ],
             pageable: {
                 info: true
             }, // enable paging
             filterable: false, // enable filtering
             sortable: true, // enable sorting
             editable: true, // enable editing
             toolbar: ["save", "cancel"], // specify toolbar commands

             dataSource: {

                 serverPaging: false,
                 serverSorting: false,
                 serverFiltering: false,
                 pageSize: 5,
                 schema: {
                     data: "Data",
                     total: function (res) {
                         return res.total;
                     },
                     model: {
                         id: "DOCUMENT_ID",
                         fields: {


                             DOCUMENT_ID: { editable: false },
                             Document_Category: { editable: true },
                             DOCUMENT_TITLE: { type: "string" },
                             DOCUMENT_DESCRIPTION: { type: "string" },
                             tags: { type: "string" },
                             DOCUMENT_FILE_NAME: { type: "string", editable: false },
                             DOCUMENT_FILE_SIZE: { type: "string", editable: false },
                             DOCUMENT_CREATION_DATE: { type: "date", editable: false }

                         }
                     }
                 },
                 //  pageable: true,
                 batch: true,
                 transport: {

                     read: {
                         url: "GetDocuments?category_id=-1",
                         contentType: "application/json; charset=utf-8",
                         type: "POST"
                     },
                     update: {
                         url: "Update", service.
                         contentType: "application/json; charset=utf-8",
                         type: "POST"
                     },
                     destroy: {
                         url: "Destroy",
                         contentType: "application/json; charset=utf-8",
                         type: "POST"
                     },
                     parameterMap: function (data, operation) {
              

                         if (data.models) {
                             return JSON.stringify({ documents: data.models });
                         } else if (operation == "read") {
                             //Page methods always need values for their parameters

                             data = $.extend({ sort: null, filter: null }, data);

                             return JSON.stringify(data);
                         }
                     }
                 }
             }
         });
     });


     function categoryDropDownEditor(container, options) {

         $('<input data-text-field="Document_Category_Name" data-value-field="Document_Category_ID" data-bind="value:' + options.field + '"/>')
                        .appendTo(container)
                        .kendoDropDownList({
                            autoBind: false,
                            dataSource: category_items // array of document categories
                        });
     }


 
Alexander Valchev
Telerik team
 answered on 11 Nov 2013
1 answer
599 views
Hello I have a treeview where I have added a integer Id as a hmtlattribute.  This is a MVC4 Kendo UI project.

branch.Add().Text("Item " + child).HtmlAttributes(new { data_foo = childs.MyId })

I am trying to access it from a button click event when a node is selected to pass foo to another view.

$("#btn").click(function () {
        var treeview = $("#treeview").data("kendoTreeView");
        var treeSelect = treeview.select();
        var passId = treeSelect.attr("foo");
        window.location = "@Url.Action("Index","Content")" + "?MyIntegerParameter=" + passId;*
});

Here is the element from Chrome

<li class="k-item" data-foo="30" data-uid="7f3430d0-4b01-4b08-b4be-1264d3ff16d3" role="treeitem" aria-selected="true" id="treeview_tv_active">
    <div class="k-top">
        <span class="k-in k-state-selected">This Is The Text</span>
    </div>
</li>

How can I access this from the button click and send it in the Action?
Dimiter Madjarov
Telerik team
 answered on 11 Nov 2013
9 answers
172 views
Hi,

Can someone guide me to resolve following issue/bug.

http://eesea.antheminfotech.net/countries

Upload button: (Countries, Location type and Terminal type)
a.      In any of the page, click new
b.      Click upload and choose any image
c.      Click cancel
d.      Bug: The upload button turns blue and remains so.

Dimiter Madjarov
Telerik team
 answered on 11 Nov 2013
3 answers
109 views
The error thrown is: Uncaught TypeError: Cannot call method 'closest' of undefined.
I have created a simple app to reproduce the behavior.

Attached is the full project with kendo and jQuery dependencies, but I am including the source for search relevance.

index.html
<!DOCTYPE html>
<html>
    <head>
        <title></title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <!-- Kendo UI Mobile CSS -->
        <link href="styles/kendo.common.min.css" rel="stylesheet" />
        <link href="styles/kendo.default.min.css" rel="stylesheet" />
        <link href="styles/kendo.mobile.all.min.css" rel="stylesheet" />
 
        <!-- jQuery JavaScript -->
        <script src="js/lib/jquery/jquery.min.js"></script>
 
        <!-- Kendo UI Mobile combined JavaScript -->
        <script src="js/lib/kendo/kendo.all.js"></script>       
    </head>
    <body>
        <div data-role="layout" data-id="myLayout">
            <div data-role="header">
                <div data-role="navbar">
                    <a id="btnBack" class="nav-button" data-align="left" data-role="backbutton">Back</a>
                    <span data-role="view-title"></span>
                    <a id="btnOK" class="nav-button" data-align="right" data-role="button" href="page2.html">Next</a>
                </div>
            </div>
        </div>
 
        <div data-role="view" data-title="Test App" data-layout="myLayout">
            Welcome to the app
        </div>
 
        <script>
            var app = new kendo.mobile.Application(document.body,
                    {
                        transition: 'slide'
                    });
        </script>
    </body>
</html>
page2.html
<!DOCTYPE html>
<html>
    <head>
        <title></title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    </head>
    <body>
        <script src="js/app/page2.js"></script>
        <div data-role="view" data-layout="myLayout" data-model="p2Model" data-reload="true">
            <ul data-role="listview" data-template="listItem" data-bind="source: dsList"></ul>
        </div>
 
 
        <script id="listItem" type="text/x-kendo-template">
            #: FirstName # #: LastName #
        </script>
    </body>
</html>

js/app/page2.js
var p2Model;
if (p2Model == null)
{
    p2Model = kendo.observable({
        dsList: new kendo.data.DataSource({
            data: [{id: 1, FirstName: "Bilbo", LastName: "Baggins"}, {id: 2, FirstName: "Malcolm", LastName: "Reynolds"}]
        })
    });
}

I set the reload="true" attribute on the root view in page2.html because my desire is to have the page refresh with changes made to the underlying model (p2Model) as well as update the datasource's data. When page2 is visited the first time, everything works as expected. But if you hit the back button in the app,  and then visit page2 again, the error is thrown.
What is interesting to note is that if the singleton behavior of the p2Model is removed and it is reconstructed on each page2 visit, then it also works as expected.
However, I desire to have some persistent attributes of the p2Model that could be set while visiting page2 and would not be lost when the page is revisited.
Ideally I could use something like a requireJS module for this, but I have not seen any examples on how to leverage it with remote views.

Are there any examples or best practices on how to leverage modular javascript in remote views? In the Kendo Music Store tutorial it seems to imply that Kendo will automatically load the .js module with the same name as a view (http://docs.kendoui.com/tutorials/Mobile/Kendo%20Mobile%20Music%20Store/kendo-mobile-music-store-organization#js-file-per-view) but I have not observed this working with a remote view like page2.html. Or perhaps my understanding of requireJS is incorrect.

Thanks
Petyo
Telerik team
 answered on 11 Nov 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?