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

How to refresh a grid with parameters

3 Answers 2306 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Seaman
Top achievements
Rank 1
Seaman asked on 09 Apr 2012, 10:36 AM
How to refresh a grid with parameters, I write that, but it's not work,pls help me ,thanks.
                     grid_ .dataSource.read({
                          url: "charge-property/resources/unit_list_data.jsp",
                          dataType: "json",
                         data: {
                             q: "test"
                         }
                      });
                     grid_.refresh();

3 Answers, 1 is accepted

Sort by
0
Petur Subev
Telerik team
answered on 09 Apr 2012, 12:18 PM
Hello Seaman,

I am not sure I understand your question, what exactly you are trying to achieve ? The object you pass to the read method is used to send additional values (they are serialized and appended to the query string) to the server and it is not a configuration object used for the Ajax request.

Regards,
Petur Subev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Seaman
Top achievements
Rank 1
answered on 09 Apr 2012, 04:13 PM
the code               
  var grid_=$("#grid_right").kendoGrid({
                    dataSource: {
                        type: "json",
                        transport: {
                            read:{
                                url: "charge-property/resources/unit_list_data.jsp",
                                dataType:"json",
                                data: {
                                    q: "1231453456456"
                                }
                            }
                 ..........................................
                 ..........................................
                }).data("kendoGrid");

I want to in a button in the event,The parameter q modify the into test(old  q: "1231453456456" )

the code :
 grid_ .dataSource.read({
                          url: "charge-property/resources/unit_list_data.jsp",
                          dataType: "json",
                         data: {
                             q: "test"
                         }
                      });
                     grid_.refresh();
pls help me ,thanks.

hi Petur Subev, do you Understand now ?

0
Petur Subev
Telerik team
answered on 12 Apr 2012, 10:45 AM
Hi Seaman,

As I replied in my previous post you should directly pass the object you want to send to the server.
e.g.
function onSomeButtonClick(){
    grid_.dataSource.read({q:"test"});
}

Also you do not need to use the refresh method of the Grid - it will be automatically refreshed.

Regards,
Petur Subev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Grid
Asked by
Seaman
Top achievements
Rank 1
Answers by
Petur Subev
Telerik team
Seaman
Top achievements
Rank 1
Share this question
or