Telerik Forums
Kendo UI for jQuery Forum
0 answers
178 views

Hi,
I created a new Kendo UI for MVC application.
Dropped a KendoTreeview on my layout view.
All is well.
I add the following js code shown below to handle the select event.
When I select a node, I get the error shown in the attached screenshot.
I did some searching on the web, and it suggested that I had the wrong version of Jquery.
I am currently running Kendo 2013.2.716 and jquery 1.9.1. I tried 1.8.2 and 2.0 of jquery but still get the same result.
Any help would be appreciated.

<script type="text/javascript" >
 
    function _LayoutOnLoad()
    {
        $(function ()
        {
            var tv = $("#MainMenu").kendoTreeView(
                {
                    select: OnMainMenuSelect
 
                });
        });
 
 
    }
    function OnMainMenuSelect(e)
    {
        //alert("Selecting: " + this.text(e.node));
        alert("Selecting: " + e.node.contentText);
    }
    </script>
Randy Hompesch
Top achievements
Rank 1
 asked on 26 Jul 2013
1 answer
70 views
Greetings !

We have this grid displaying two "time" columns with corresponding TimePickers. The TimePickers shows up right in edit mode but the values initially loaded from the database aren't displayed... So when the grid appears, the two time columns are empty.

The jobs.php controller returns time values formatted as "HH:mm:ss" so strings comes looking like "17:15:00"... and the Grid must display them without the seconds. "HH:mm"

01.    $("#grid").kendoGrid({
02.        editable:true,
03.        culture:"fr-FR",
04.        dataSource: {
05.            transport: {
06.                read: {
07.                    url: "./jobs.php",
08.                    dataType:"json",
09.                    data:{f_id: f_id, action:"read"}
10.                },
11.                create: {
12.                    url: "./jobs.php",
13.                    dataType:"json",
14.                    data:{f_id: f_id, action:"create"}
15.                },
16.                update: {
17.                    url: "./jobs.php",
18.                    dataType:"json",
19.                    data:{f_id: f_id, action:"update"}
20.                },
21.                destroy: {
22.                    url: "./jobs.php",
23.                    dataType:"json",
24.                    data:{f_id: f_id, action:"destroy"}
25.                }
26.     
27.            },
28.            autoSync: true,
29.            error: function(e) {
30.                alert(e.responseText);
31.            },
32.            schema: {
33.                data: "data",
34.                model:{
35.                    id:"id",
36.                    fields: {  
37.                        id: { editable: false },
38.                        start: {type:"date"/*validation: { required: true}*/ },
39.                        end: { type:"date"/*validation: { required: true}*/ },
40.                    }
41.                }
42.            }
43.        },
44.        columns: [ 
45.                  { field: "start", title:"Start", format: "{0: HH:mm}", editor:  timeEditor},
46.                  { field: "end", title:"End"  , format: "{0: HH:mm}", editor:  timeEditor},
47.                  {
48.                      command: "destroy"
49.                  }]
50.    });
51. 
52.}
53.function timeEditor(container, options) {
54.    $('<input data-text-field="' + options.field + '" data-value-field="' + options.field + '" data-bind="value:' + options.field + '" data-format="' + options.format + '"/>')
55.            .appendTo(container)
56.            .kendoTimePicker({
57.                culture: "fr-FR",
58.                interval: "15",
59.                format: "HH:mm",
60.                min: new Date(2013, 6, 24, 0, 0, 0, 0),
61.                max: new Date(2013, 6, 24, 23, 59, 0, 0)
62.            });
63.}
Vladimir Iliev
Telerik team
 answered on 26 Jul 2013
1 answer
243 views
I have a mobile listview bound to kendoui datasource pointing to an odata service. I have a $expand hint in the datasource config to expand "Patient" property of "Claim" object, but looking the url of the odata query, the kendoui datasource is not generating the $expand code in the querystring. How can I get the kendoui datasource to generate correct $expand instruction on the querystring?

    OData query string genereated: http://localhost:1839/OData.svc/Claim?$callback=jQuery20207924230222124606_1374374358450&%24inlinecount=allpages&%24format=json&%24top=10

    <script>
        $(function () {
            var app = new kendo.mobile.Application(document.body, {
                transition: 'slide'
            });

            OData.defaultHttpClient.enableJsonpCallback = true;
            
            
            var data = new kendo.data.DataSource({
                type: "odata", // specifies data protocol
                pageSize: 10,  // limits result set
                transport: {
                    read: "http://localhost:1839/OData.svc/Claim",
                    dataType: "json",
                    data: {
                        $expand: "Patient"
                    }
                },
                schema: {
                    model: {id: "Id"},
                    data: function (data) {
                        return data.d.results;
                    },
                    total: function (data) {
                        return data.d.__count;

                    }
                },
                pageSize: 10,
                serverPaging: true,
                serverFiltering: true,
                serverSorting: true
            });

            $("#lst").kendoMobileListView(
            {
                template: "<strong>${data.ClaimNumber}</strong><br/>",
                filterable: {
                    field: "ClaimNumber",
                    operator: "contains"
                },
                dataSource: data
            });
        });
    </script>
Daniel
Telerik team
 answered on 26 Jul 2013
1 answer
198 views
Lets say i have different types 'A','B','C' in my app 

and I am trying to assign this below result of type 'A'

class A
{
  List<B>

  List<C>
}

to the tree view at any level. Can the tree view read all the list items of B and C from the object of type 'A'.

Something like this below:

+ B (parent tree view items)
     - child tree view items
+ C (parent tree view items)
    - child tree view items

Please help with any suggestions.








Petur Subev
Telerik team
 answered on 26 Jul 2013
4 answers
246 views
I have a grid and I am editing most of the fields inline. However I have
a field, the way I envision to modify this field is to open a popup
window when clicked ( this will be a hyperlink field in the grid). Once
the value is modified in the Popup the change will be saved in the
database and the same change should also reflect in the grid. The grid
should be refreshed once the popup is closed. Can you please suggest me
as to how to accomplish this. Also can you provide me samples as to how
to do this.
Thank you
Kavitha
Alexander Valchev
Telerik team
 answered on 26 Jul 2013
1 answer
211 views
My app has a large list of data (only 1 column) and I have to show them all (no paging). With a small amount of data it works fine but when I have all the data in (around 260 items, not that many) the grid disappears from the page. Debugging shows a 500 error on the server. 

I have done the following testing:
- I tried the page on Chrome, IE and Opera. All give the same result.
- I replaced the grid with a treeview. Same result - with around 150 entries it's fine, with 260 it disappears (although in the case of the treeview it doesn't disappear completely, it leaves a message that the request failed and a button to retry.

How I'm getting the data:

@(Html.Kendo().Grid<Song>()
                      .Name("SongsGrid")
                      .Columns(columns =>
                          {
                              columns.Bound(o => o.Name);
                          })
                      .DataSource(dataSource => dataSource.Ajax().Read(read => read.Action("SongList", "Song")))
                      .Selectable()
                      .Events(events => events.Change("songSelected"))
                      )

and

@(Html.Kendo().TreeView().Name("treeviewSongs")
            .HtmlAttributes(new {@class="demo-section" })
            .DataTextField("Name")
            .DataSource(dataSource => dataSource.Read(read => read.Action("SongListForTreeview", "Song")
        )

What are my options?

Thanks.
Dimo
Telerik team
 answered on 26 Jul 2013
1 answer
102 views
Hello all,

I have a grid that I list all the folder and the size of the folder, I have java script code that transform a size of the folder accordingly.  So a folder size can be 8 MB, 1 Gig, 400 KB, etc.  Obviously, this is a text field so we can give the user the correct information and the unit we measure the size of the folder.  Sorting does not work correctly since it is text. 

Is there a way to say for this column if you are going to sort this text column using the raw size field (or specify a specific column to use for sorting).  Meaning I have a second column in my model that has the raw size as int and I would like to use for sorting this way, 8 MB will come before 1 Gig folder.

Is there a way to do this?  if so can you provide a simple example please.
Vladimir Iliev
Telerik team
 answered on 26 Jul 2013
1 answer
86 views
Hello,

I have attached two screens for understanding the issue.
And also attached Demo html folder which is downloaded from your site. I have edited html (examples\web\grid\index.html)
to minimize the number of columns shown in the grid.


Avijit Singh
Web Developer, Syncada from Visa
avijit.singh@usbank.com


Dimo
Telerik team
 answered on 26 Jul 2013
1 answer
441 views
Telerik/Kendo Users,

I have created a number of charts with filters based on an API and would like to know; is it possible to add a message to the graph if there is no data to display?
I do not believe that "DataBound" is useful as this would only cater for loading, not a lack of data.

Thanks,
Jamie
Iliana Dyankova
Telerik team
 answered on 26 Jul 2013
1 answer
76 views
I'm looking to set column widths via HTML, either by setting the style attribute or using data-width (or something similar). I wasn't able to find anything in the documentation about defining column widths via HTML.

Thanks
Dimo
Telerik team
 answered on 26 Jul 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?