Telerik Forums
Kendo UI for jQuery Forum
1 answer
38 views
We are converting an app from Telerik MVC to Kendo UI.  We have jQuery code on our grids to capture the current orderBy and filterBy parameters so we can pass them back to our controller.  The controller then creates an Excel download using those parameters.
However the orderBy and filterBy are now undefined in Kendo.  How do I retrieve those values?
    function onDataBound() {
        $('a.lnkDeal').each(function () {
            this.href = this.href.replace(/&/g, "%26");
        });
        var grid = $("#Deals").data('kendoGrid');
        // Get the export link as jQuery object       
        var $exportLink = $('#ExportToExcel');               
        // Get its 'href' attribute - the URL where it would navigate to       
        var href = $exportLink.attr('href');               
        // Update the 'orderBy' parameter with the grids' current sort state
        href = href.replace(/orderBy=([^&]*)/, 'orderBy=' + (grid.orderBy || '~'));
        // Update the 'filter' parameter with the grids' current filtering state       
        //href = href.replace(/filter=(.*)/, 'filter=' + (grid.filterBy || '~'));               
        // Update the 'href' attribute. Replace all ' with | to avoid security issue
        href = href.replace(/'/g, "|");
        $exportLink.attr('href', href);
    }
Atanas Korchev
Telerik team
 answered on 17 Oct 2013
1 answer
80 views
None of my views ever have scroll bars on them. Also, if I set overflow: auto on a div, it also will not have a scroll bar.

How do I allow scroll bars?
Kiril Nikolov
Telerik team
 answered on 17 Oct 2013
2 answers
77 views
I've got a grid:
$('#myGrid').kendoGrid({
    ...
    scrollable: false,
    ...
});
and I've tried all of these things to change the scrollable property:
$('#myGrid').data("kendoGrid").options.scrollable = true;
$('#myGrid').data("kendoGrid").refresh();
 
$('#myGrid').data("kendoGrid").scrollable = true;
$('#myGrid').data("kendoGrid").refresh();
 
var MyGrid = $('#myGrid').data("kendoGrid");
MyGrid.options.scrollable = true;
MyGrid.refresh();
 
var MyGrid = $('#myGrid').data("kendoGrid");
MyGrid.scrollable = true;
MyGrid.refresh();
Nothing works. How does one change whether a grid is scrollable on the fly?
Vladimir Iliev
Telerik team
 answered on 17 Oct 2013
1 answer
187 views
I have a datasource (array) with Knockout observable properties.
I want the grid to display the value of the observable in the grid.

Grid configuration excerpt:
columns: [
                    { field: "Name"}
]

Here, Name is a Knockout observable. But it doesn't work, because the grid expects a normal js property.
Is there a way to get this working without converting all observables back to normal properties?

Atanas Korchev
Telerik team
 answered on 17 Oct 2013
3 answers
234 views
My view contains a lot of content, and I wish to give the user shortcuts to scroll to specific parts of the page.

I see that it's possible to scroll using scrollTo, but the value has to be given as a number. As screen sizes vary I don't know the specific height values for the different places I wish to scroll.

Is there a smart way to for example scroll to the element with id="ScrollPosition1"?
Kiril Nikolov
Telerik team
 answered on 17 Oct 2013
5 answers
69 views
Endless Scrolling Issues Since Update!
OK another thread as I've worked out my woes are to do with endless scrolling and the kendo update changes.
All I want is to retrieve my data and have it endlessly scroll like it did before. But it appears broken.


This works:
http://jsbin.com/aNApID/8/


This doesn't (its my datasource)
Note: Ive hidden my access keys with 'HIDDEN' so it won't work if you do get the syntax right, I just want to be pointed in the right direction

var dataSource = new kendo.data.DataSource({
    pageSize: 10,
    serverPaging: false, //specifies whether the paging should be handled by the service
   transport: {

                read: {
                type: 'GET',
                headers: {'X-Parse-Application-Id':'HIDDEN','X-Parse-REST-API-Key':'HIDDEN'},
                url: "https://api.parse.com/1/classes/Listings/?where={\"State\":\"VIC\",\"EndDateTime\":{\"$gte\":{\"__type\":\"Date\",\"iso\":\""+localStorage.ls_tempdate+"\"}}}&order=StartDateTime",           
                dataType: "json" // JSONP (JSON with padding) is required for cross-domain AJAX
                    },
        parameterMap: function(options) {
            var parameters = {
                q: "javascript", //additional parameters sent to the remote service
                rpp: options.pageSize,
                page: options.page //next page
            };

            return parameters;
        }
    },
    
 schema: { // describe the result format
        data: "results" // the data which the DataSource will be bound to is in the "results" field
    }
});

Kiril Nikolov
Telerik team
 answered on 17 Oct 2013
1 answer
47 views
i've got a strange problem using transport.destroy:

First i have a Listview with a swipe event to open the delete option.
i did implement this: http://demos.kendoui.com/mobile/listview/editing.html#/ in my app.
everything work fine, except destroy will be called for X+1 (x = deleted items)

At first deletion it will be called once, at the 2nd time it will be called twice and so on.

Here is the JSBin: http://jsbin.com/AGAGUfE/11/

Did i implement something false?
or is it a bug in Kendo UI mobile? (i think kendo Ui is the same)


Thanks for your help
domiSchenk
Top achievements
Rank 1
 answered on 17 Oct 2013
2 answers
80 views
Hi,
I m create a kendo Excel grid with hierarchy. And last column I added a action button.
I need to get first column data of the grid when clicking that edit button.

This is my try. But its not working.

function On Click(e) {
        e.preventDefault();
        var element = $(e.target);
        var grid = element.closest("[data-role=grid]").data("kendoGrid");
        var dataItem = grid.dataItem(element.closest("tr"));

        alert(dataItem.ProductID);
       
    }

Thanking
Håkan
Top achievements
Rank 1
 answered on 17 Oct 2013
2 answers
290 views
I am experiencing a strange issue with my kendo grids; if I delete a row, the row is successfully removed, and the XHR DELETE request is successful. Any subsequent inserts or updates to my kendo grid however, are always sending an extraneous DELETE request, and failing. 

Also, if I delete multiple rows from my grid, then any subsequent inserts or updates will send multiple extraneous DELETE requests, one for each of the earlier successful deletes.

The extraneous DELETE requests are failing (status 500). Presumably because the rows in question have already been deleted. This causes the insert/update to fail as well.

Any clue to what's happening? Does the kendo grid queue up the DELETE requests but is somehow keeping successful DELETE requests in this queue?

Thanks in advance.
Patrick
Top achievements
Rank 1
 answered on 16 Oct 2013
2 answers
7.4K+ views
I am calling a WCF webservice which exposes a POST method for login (returns user data if successful).  When I make the call via jQuery Ajax it works as expected, but when I make the equivelant Kendo UI DataSource call it fails.  Here are the basics:

VARIABLES USED IN THE SAMPLE CODE:
jsonData = {"userName":"abc123","password":"abc123"}
url = "../Authentication.svc/Login3"

KENDO CALL (fails):
---------------------
var dataSource = new kendo.data.DataSource({
    transport: {
               read: {
                       url: url,
                       dataType: "json",
                       data: jsonData,
                       type: "POST",
                       contentType: "application/json",
                       processData: false
                     }
               }
});

REQUEST PAYLOAD AS SHOWN IN NETWORK TAB OF CHROME DEBUGGER:
[object Object]
RESULT: 400 - Bad Request
------------------------------------------

AJAX CALL (works!):
-----------------
$.ajax({
         url: url,
         type: "POST",
         contentType: "application/json",
         data: jsonData,      
         processData: false,  
         dataType: "json"    
 });

REQUEST PAYLOAD AS SHOWN IN NETWORK TAB OF CHROME DEBUGGER:
{"userName":"abc123","password":"abc123"}
RESULT: 200 - Successful

Any ideas or assistance would be appreciated.

Doug

Jerome
Top achievements
Rank 1
 answered on 16 Oct 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?