I am using Kendo UI web Grid on ASP.NET MVC 4 Application.
I noticed a strange problem in it.
I have a grid with about 72 records, which will show only 20 records per page size.
you can click on pagination to see next 20 records.
after you click on next page 2 you can see next 20 records of 72.
Here I have a jQuery call to refresh grid.
var grid = $("#myGrid").data("kendoGrid");
grid.dataSource.read();
I noticed the problem is, when I use jQuery to read the grid again.
It is not resetting [DataSourceRequest] DataSourceRequest request and that is creating the problem.
How can i fix this.
Solution
following #paris below code resolved the issue.
var grid = $("#myGrid").data("kendoGrid");
grid.dataSource.page(1);
grid.dataSource.read();
Try putting grid.dataSource.page(1); before the read() call if you don't mind refreshing the grid back to page one.
Related
I have two kendo grid in one page and the results of the first grid should be reflected to the second grid. For instance, Grid1 = list of subjects, Grid2 = list of students, if I have to add new subject, it should be right away available on the students dropdown column for subjects without the need of refreshing the whole page.
Hopefully someone could help. Thanks.
I was able to do it by having an ajax call inside complete: function(e){ // ajax call to update } to update the dropdownlist. Thank you guys.
Can any one please let me know how can I load first 5000 rows into kendo grid and then load the remaining rows on page selects. I have 50000 rows to load and the page with kendo grid is loading pretty slow. So I want to use lazy loading approach..like loadin gthe first 5000 and then load the next rows in 1000's on page button clicks.
Any help appreciated!
You can either enable virtual scrolling or implement server paging.
I have a grid,
grid = new Slick.Grid("#myGrid", loader.data, columns, options);
How do I get the grid to reload? I'm using a remote model as by the examples as provided by the slickgrid documentation.
I want to force the reload based on clicking a button.
Thanks
I found my problem.
I'm using the remotemodel from Slickgrid's examples. The problem I had was I did not "clear()" the data. The "clear()" function deleted all of the old data it contained. I then invalidated and everything worked.
I am using the Kendo UI Cascading combo boxes in an MVC 4 application. The source is too complex to post here, however it follows exactly the same structure as the MVC demo on the Kendo UI site (http://demos.kendoui.com/web/combobox/cascadingcombobox.html).
Occasionally I am getting the exception below, I assume this is because the page isn't fully loaded and the user has tried to interact with the page, therefore causing the combo to attempt to submit an AJAX request to get it's data.
Microsoft JScript runtime error: Cannot call method 'value' of kendoDropDownList before it is initialized
Is there a correct way of checking whether Kendo controls are fully initialised ? If not how can I catch this exception ?
Thanks, Jon.
Make sure load the combo box before you call
var val = $("#yourCombobox").value();
if your combobox isn't initialize it gives undefined as the result.
Load the main combo at the $(document).ready() function and then the onchange even of that combo get the value and load the next combo.
I have a grid like this:
To edit a line, the user chooses one from the grid an click the "pen" icon. Then, the record is displayed in the form.
To save the form, choose the save button link. Ok.
Now I need to update the line in the grid.
I get this working, doing the follow in javascript:
$.post(this.href,
sf,
function (response) {
$("#form-edicao").html(response);
var $grid = $("#Grid").data("tGrid");
$grid.rebind(); //==this line update the grid
});
But this approach updates all the grid, return to the first page...
I need to update just one line.
In common table grids, I replace some html elements. How to do this in this mysterious grid?
Taking a look at the Client-side API of the Grid component I think that using .ajaxRequest() instead might be what you're looking for. .rebind() resets the state (page number, filter/sort expressions etc.) while .ajaxRequest() shouldn't.