This is a migrated thread and some comments may be shown as answers.

grid setOptions() deletes all data

1 Answer 72 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Gavin
Top achievements
Rank 1
Gavin asked on 22 Jun 2016, 10:22 AM

Hi, Am using Telerik MVC wrappers for creating a grid. Done an ultra simple example of this and this seems to be enough to repeat the issue:

 

cshtml:

@Html.Kendo().Grid(Model.Records).Name("Search")

If I just use the above, I get the grid with all the data in it no problem, however if I decide I want to make it sortable on the fly, I run what I understand to be the correct js below, this just causes all the data to be deleted with no errors.

javascript:

$('#Search').data('kendoGrid').setOptions({ sortable: true });

 

is there something you have to do with MVC wrapper settings to make the javascript methods less flaky?

 

Also, am using latest trial version as of this date.

 

Thanks,

Gavin

1 Answer, 1 is accepted

Sort by
0
Kostadin
Telerik team
answered on 24 Jun 2016, 07:09 AM
Hi Gavin,

I am afraid this will not work in case you are using a Server binding because the Grid does not expose such option and also you cannot modify the QueryString parameters (the collection is read only). in order to be able to set the sortable by using the setOption method you need to use an Ajax binding.

Regards,
Kostadin
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Grid
Asked by
Gavin
Top achievements
Rank 1
Answers by
Kostadin
Telerik team
Share this question
or