{"action":"created","issue":{"url":"https://api.github.com/repos/wenzhixin/bootstrap-table/issues/764","labels_url":"https://api.github.com/repos/wenzhixin/bootstrap-table/issues/764/labels{/name}","comments_url":"https://api.github.com/repos/wenzhixin/bootstrap-table/issues/764/comments","events_url":"https://api.github.com/repos/wenzhixin/bootstrap-table/issues/764/events","html_url":"https://github.com/wenzhixin/bootstrap-table/issues/764","id":69284306,"number":764,"title":"Allow query params to be specified during refresh.","user":{"login":"Sivalingaamorthy","id":5063817,"avatar_url":"https://avatars.githubusercontent.com/u/5063817?v=3","gravatar_id":"","url":"https://api.github.com/users/Sivalingaamorthy","html_url":"https://github.com/Sivalingaamorthy","followers_url":"https://api.github.com/users/Sivalingaamorthy/followers","following_url":"https://api.github.com/users/Sivalingaamorthy/following{/other_user}","gists_url":"https://api.github.com/users/Sivalingaamorthy/gists{/gist_id}","starred_url":"https://api.github.com/users/Sivalingaamorthy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sivalingaamorthy/subscriptions","organizations_url":"https://api.github.com/users/Sivalingaamorthy/orgs","repos_url":"https://api.github.com/users/Sivalingaamorthy/repos","events_url":"https://api.github.com/users/Sivalingaamorthy/events{/privacy}","received_events_url":"https://api.github.com/users/Sivalingaamorthy/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/wenzhixin/bootstrap-table/labels/help%20wanted","name":"help wanted","color":"bfe5bf"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-04-18T08:10:55Z","updated_at":"2015-04-20T02:01:59Z","closed_at":"2015-04-20T02:01:59Z","body":"Hi \r\n\r\nFrom change log I came to know that I can specify the queryparam on refresh, how to do it, can you provide one sample code for this.\r\n\r\nhttps://github.com/wenzhixin/bootstrap-table/blob/master/CHANGELOG.md\r\n1.6.0 - [enh] Allow query params to be specified during refresh.\r\n\r\nI tried specifying the queryparam for refresh, but it takes the queryparam values, when table got initialized.\r\n\r\nMy requirement is, on initialize the table, i will initialize default value\r\n\r\nvar startDate='12/12/2014'\r\n\r\n  $(\"#myTable\").bootstrapTable({\r\n        url: urlPrefix,\r\n        method: 'post',\r\n        queryParams: function (p) {\r\n            return {\r\n                availabilityDate: startDate\r\n            };\r\n        },\r\n\r\non refresh i want to assign different value and refresh the grid data.\r\n\r\nstartDate='12/13/2014'\r\n\r\n   $('#myTable').bootstrapTable('refresh', {\r\n                url: urlPrefix\r\n                , method: 'post',\r\n                queryParams: function (p) {\r\n                    return {\r\n                        availabilityDate: startDate\r\n                             };\r\n                },\r\n            });\r\nbut when I check using jsfiddle, on refresh found json data has date ''12/12/2014''  instead of 12/13/2014. what is wrong ? how to reset the queryParam on refresh. \r\n\r\nPlease suggest."},"comment":{"url":"https://api.github.com/repos/wenzhixin/bootstrap-table/issues/comments/94337206","html_url":"https://github.com/wenzhixin/bootstrap-table/issues/764#issuecomment-94337206","issue_url":"https://api.github.com/repos/wenzhixin/bootstrap-table/issues/764","id":94337206,"user":{"login":"wenzhixin","id":2117018,"avatar_url":"https://avatars.githubusercontent.com/u/2117018?v=3","gravatar_id":"","url":"https://api.github.com/users/wenzhixin","html_url":"https://github.com/wenzhixin","followers_url":"https://api.github.com/users/wenzhixin/followers","following_url":"https://api.github.com/users/wenzhixin/following{/other_user}","gists_url":"https://api.github.com/users/wenzhixin/gists{/gist_id}","starred_url":"https://api.github.com/users/wenzhixin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wenzhixin/subscriptions","organizations_url":"https://api.github.com/users/wenzhixin/orgs","repos_url":"https://api.github.com/users/wenzhixin/repos","events_url":"https://api.github.com/users/wenzhixin/events{/privacy}","received_events_url":"https://api.github.com/users/wenzhixin/received_events","type":"User","site_admin":false},"created_at":"2015-04-20T02:01:59Z","updated_at":"2015-04-20T02:01:59Z","body":"Hi @Sivalingaamorthy , you can do it by this:\r\n```js\r\nqueryParams: function (p) {\r\n    return {\r\n        availabilityDate: $('#startDate').val() // your date element\r\n    };\r\n}\r\n```\r\nor:\r\n```js\r\n$('#myTable').bootstrapTable('refresh', {\r\n    query: {\r\n        availabilityDate: startDate\r\n    }\r\n});\r\n```\r\n\r\nThe docs: http://bootstrap-table.wenzhixin.net.cn/documentation/#methods\r\n"}}