Telerik Forums
Kendo UI for jQuery Forum
1 answer
76 views
When the grid is populated, the default sorting is taken from:
    serverPaging: true,
    serverSorting: true,
    sort: { field: "Name", dir: "asc" },
    serverFiltering: true,
    pageSize: 10
When I click the Name column header, the grid sorts in desc order as expected.
When I click for a second time, the options.sort array is not populated.
When I click for a third time, the grid sort in asc order.
It seems that for every second click the options.sort array is not being poulated.
Can this be resolved.

This is the code that I am using:

var investorDataSource = new kendo.data.DataSource({
                type: "json",
                transport: {
                    read: {
                        url: "http://localhost//XXXX?Name=^" + $("#searchfor").val(), 
                        dataType: "json"

                    },
                    parameterMap: function (options) {
                        return {
                            pageindex: options.page,
                            pagesize: options.take,
                            //orderby:options.sort[0].field
                            orderby: convertSort(options.sort)
                        }
                    }
                },
                schema: {
                    data: function (result) {
                        return result.Items || result;
                    },
                    total: function (result) {
                        //Note: this is != to the total no of records, but should work
                        return (result.PageSize * result.PageCount) || result.length || 0;
                    }
                },

                serverPaging: true,
                serverSorting: true,
                sort: { field: "Name", dir: "asc" },
                serverFiltering: true,
                pageSize: 10
            });

Jeff
Top achievements
Rank 1
 answered on 28 Feb 2012
1 answer
89 views
I'm seeing a bug when auto-generating columns with the grid. If the JSON data has a space as the field name, the template created has the space. For example, note the #Feb 2012#. Does the templating system support this? Is it just unescaped/quoted?

<tr><td>#=FirstName#</td><td>#=LastName#</td><td>#=Department#</td><td>#=Feb 2012#</td></tr> 
Iliana Dyankova
Telerik team
 answered on 27 Feb 2012
12 answers
270 views
The TimePicker doesn't appear to work properly on the iPad.  The scrollbar doesn't appear in the menu and it is very hard to scroll thru the times.  When I tried to flick it, it just moved the actual browser window, same happens in your demo.

This is not a huge deal to me, I'm just not going to use that control, but I do want to know if this is something you are aware of and/or plan to fix in the future.  On a side note, are the web controls not really meant for iPad dev, shoudl I be using the "Mobile" tools?  I went with web just because there are so many more available.
Richard
Top achievements
Rank 1
 answered on 27 Feb 2012
2 answers
160 views
Hi,

I am not using the default file list (showFileList: false) and implementing a custom one. I need to implement the cancel upload functionality but I don't seem to find any events and API's that I can use. 
Just surfing through kendo.upload.js, I believe that jquery (xmlhttprequest)  
abort() and some iframe stop commands are used by the default implementation. If this is correct, I see no way of getting either an xmlhttprequest or iframe object to replicate this behavior.
So how can I trigger the cancel functionality manually.

Thanks,
Danish
T. Tsonev
Telerik team
 answered on 27 Feb 2012
1 answer
286 views
OK... we sync to our data source but there is not event to let us respond with an event.

Use Case:
1. We add a new record to the browser grid dataset. (It shows up at the bottom of the grid. We want it at the top.)
2. We sync the data.
3. We read the data but it rarely has sync'd in time for the read to work, just pulls pre-sync'd data.

Of course if we could just get the added row to appear on top this would be a non-issue. :) I think we should have this event item added to the toolset just the same.
Rosen
Telerik team
 answered on 27 Feb 2012
3 answers
50 views
Hello,

In the "What's new" webinar yesterday I hoped to see demos of the planned MVVM framework and ListView widget (according to the roadmap). But it disappointed me that there was nothing new shown in the webinar.
And at the end of the webinar I was invited to download the 2012Q1 release, but as far as I can see, that is not available yet, even not in beta.
Is it still the planning to release a version in march with the MVVM framework and the ListView widget?
I am eager to start using both!
Can I get my hands on a beta version, so I can start my development?

Regards, Jaap
Atanas Korchev
Telerik team
 answered on 27 Feb 2012
1 answer
88 views
In a click event I dynamically add a new descent path at the top level of the treeview (at parent=null).  The problem is that new nodes do not match the css used to color the different levels.

In firebug it looks like my original levels are started in <LI> tags and the new appended nodes are started in <UL>

http://jsfiddle.net/6dKwH/

Any tips on .append() or css are appreciated!
Richard
Top achievements
Rank 1
 answered on 27 Feb 2012
2 answers
97 views
Hey

Is it possible to bind a column to a related table?

If i add a column like this where "tblCategory" is the related table:

{
         field: "tblCategory",
         title: "Category"
}

I can see that it's an [Object] and that it does refer to: "data.svc/tblProducts(1)/tblProducts"

Is it possible to get the data from that somehow?

Cheers
Stefan
Top achievements
Rank 2
 answered on 27 Feb 2012
9 answers
277 views

I'm unable to load any data from my server into a grid that I'm trying to setup for simple paging without resorting to using the solution posted in the  Kendo Grid Forum that uses a jquery ajax request to directly populate the "data" member directly of the kendo.data.DataSource.  I am returning a simple json response that contains an array and a count to support paging (for example):

{"artists":[{"ID":4471,"Name":"10
Years","Gender":"Male","Category":"Pop/Rock"},{"ID":4391,"Name":"10,000
Maniacs","Gender":"Female","Category":"Pop/Rock"},{"ID":15,"Name":"10cc","Gender":"Male","Category":"Pop/Rock"},"count":2004}

This is my 1st cut at a datasource, and I've verified the server gets called and returns the json as above, but nothing displays in the grid:

var artistSource = new kendo.data.DataSource({
    transport: {
        read: {
            url: "http://localhost:53596/api/Artists?format=json",
            dataType: "jsonp"
        },
        schema: {
            data: "artists",
            total: "count",
            model: {
                fields: {
                    ID: { type: "number"},
                    Name: { type: "string"},
                    Gender: { type: "string"},
                    Category: { type: "string"}
                }
            }
        },
        page: 1,
        pageSize: 50,
        serverPaging: true,
        serverFiltering: true,
        serverSorting: true
    }
});

Following the workaround above, this datasource below works.  From what I can tell, I'm following the examples, but I'm not able to get the datasource populated properly, and I'd really appreciate any help!

// This is the ajax call that is used to populate the data
// member in the dataSource as described in the workaround in the forums:
function GetArtists() {
    var _resData;
 
    $.ajax({
        type: 'GET',
        url: 'http://localhost:53596/api/Artists?format=json',
        dataType: 'json',
        success: function (data) {
            _resData = data.artists;
        },
        data: {},
        async: false
    });
 
    return _resData;
}
 
// This datasource populates the data array via a jquery ajax call,
// bypassing the configuration as done in the original datasource.
var artistSource2 = new kendo.data.DataSource({
    data: GetArtists(),
    schema: {
        model: {
            fields: { ID: { type: "number" }, Name: { type: "string" }, Gender: { type: "string" }, Category: { type: "string" }
            }
        }
    }
 });
 
 // If I use artistSource2 (the workaround), the grid gets populated,
 // but if I use artistSource, nothing shows up in the grid.
 $('#Artists').kendoGrid({
     dataSource: artistSource2,
     height: 600,
     columns: [{ field: "ID" }, { field: "Name" }, { field: "Gender" }, { field: "Category"}],
     pageable: true
 });
Bahar
Top achievements
Rank 1
 answered on 27 Feb 2012
5 answers
645 views
Hi All,

I am trying to create a treeview with two levels.  For example, first level would be company names, and each company has one or more products (aka, second level). 

Please advice what is the best way to allow ONLY the second level nodes to be draggable (aka, follow the above example, I don't want the company nodes to be draggable).

Thanks!

JB
Alex Gyoshev
Telerik team
 answered on 27 Feb 2012
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?