{"action":"created","comment":{"url":"https://api.github.com/repos/orocrm/documentation/pulls/comments/36236862","id":36236862,"diff_hunk":"@@ -31,15 +31,116 @@ For example:\n             # ...\n         # ...\n \n-Our goal is to set :contactId parameter with the value from a request.\n+Our goal is to set :contactId parameter with the value from the request.\n \n-Solution 1. Create custom event listener\n-----------------------------------------\n+Solution 1: Grid Parameter binding\n+----------------------------------\n+\n+The easiest way that should be sufficient for most situations is to use parameter binding option in of the datasource\n+to configure mapping between datagrid and query parameters.\n+\n+You can do this by adding the ``bind_parameters`` option to your ``datagrid.yml`` using the following syntax:\n+\n+.. code-block:: yaml\n+    :linenos:\n+\n+        # src/Acme/Bundle/TaskBundle/Resources/config/datagrid.yml\n+        datagrid:\n+            # ...\n+            acme-tasks-grid:\n+                # ...\n+                source:\n+                    query:\n+                        where:\n+                            and:\n+                            - task.relatedContact = :contactId\n+                    bind_parameters:\n+                        # Get the \"contactId\" parameter from the datagrid\n+                        # and set its value to the \"contactId\" parameter in the datasource query\n+                        - contactId\n+                # ...\n+            # ...","path":"cookbook/how_to_pass_request_parameter_to_grid.rst","position":50,"original_position":50,"commit_id":"baa4cb64a8c806149a8acc6ec4ee65cfc23d85b3","original_commit_id":"baa4cb64a8c806149a8acc6ec4ee65cfc23d85b3","user":{"login":"xabbuh","id":1957048,"avatar_url":"https://avatars.githubusercontent.com/u/1957048?v=3","gravatar_id":"","url":"https://api.github.com/users/xabbuh","html_url":"https://github.com/xabbuh","followers_url":"https://api.github.com/users/xabbuh/followers","following_url":"https://api.github.com/users/xabbuh/following{/other_user}","gists_url":"https://api.github.com/users/xabbuh/gists{/gist_id}","starred_url":"https://api.github.com/users/xabbuh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xabbuh/subscriptions","organizations_url":"https://api.github.com/users/xabbuh/orgs","repos_url":"https://api.github.com/users/xabbuh/repos","events_url":"https://api.github.com/users/xabbuh/events{/privacy}","received_events_url":"https://api.github.com/users/xabbuh/received_events","type":"User","site_admin":false},"body":"looks like the YAML code is indented to deep","created_at":"2015-08-04T20:25:09Z","updated_at":"2015-08-04T20:25:09Z","html_url":"https://github.com/orocrm/documentation/pull/160#discussion_r36236862","pull_request_url":"https://api.github.com/repos/orocrm/documentation/pulls/160","_links":{"self":{"href":"https://api.github.com/repos/orocrm/documentation/pulls/comments/36236862"},"html":{"href":"https://github.com/orocrm/documentation/pull/160#discussion_r36236862"},"pull_request":{"href":"https://api.github.com/repos/orocrm/documentation/pulls/160"}}},"pull_request":{"url":"https://api.github.com/repos/orocrm/documentation/pulls/160","id":41401823,"html_url":"https://github.com/orocrm/documentation/pull/160","diff_url":"https://github.com/orocrm/documentation/pull/160.diff","patch_url":"https://github.com/orocrm/documentation/pull/160.patch","issue_url":"https://api.github.com/repos/orocrm/documentation/issues/160","number":160,"state":"open","locked":false,"title":"OD-117: Review Book and Cookbook","user":{"login":"akuzmenko-magecore","id":3186921,"avatar_url":"https://avatars.githubusercontent.com/u/3186921?v=3","gravatar_id":"","url":"https://api.github.com/users/akuzmenko-magecore","html_url":"https://github.com/akuzmenko-magecore","followers_url":"https://api.github.com/users/akuzmenko-magecore/followers","following_url":"https://api.github.com/users/akuzmenko-magecore/following{/other_user}","gists_url":"https://api.github.com/users/akuzmenko-magecore/gists{/gist_id}","starred_url":"https://api.github.com/users/akuzmenko-magecore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akuzmenko-magecore/subscriptions","organizations_url":"https://api.github.com/users/akuzmenko-magecore/orgs","repos_url":"https://api.github.com/users/akuzmenko-magecore/repos","events_url":"https://api.github.com/users/akuzmenko-magecore/events{/privacy}","received_events_url":"https://api.github.com/users/akuzmenko-magecore/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-08-01T13:34:11Z","updated_at":"2015-08-04T20:25:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b74b1689d649bbcf43b9d2408578b6d9ce773fa1","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/orocrm/documentation/pulls/160/commits","review_comments_url":"https://api.github.com/repos/orocrm/documentation/pulls/160/comments","review_comment_url":"https://api.github.com/repos/orocrm/documentation/pulls/comments{/number}","comments_url":"https://api.github.com/repos/orocrm/documentation/issues/160/comments","statuses_url":"https://api.github.com/repos/orocrm/documentation/statuses/baa4cb64a8c806149a8acc6ec4ee65cfc23d85b3","head":{"label":"orocrm:task/OD-117-review-cookbook","ref":"task/OD-117-review-cookbook","sha":"baa4cb64a8c806149a8acc6ec4ee65cfc23d85b3","user":{"login":"orocrm","id":4165718,"avatar_url":"https://avatars.githubusercontent.com/u/4165718?v=3","gravatar_id":"","url":"https://api.github.com/users/orocrm","html_url":"https://github.com/orocrm","followers_url":"https://api.github.com/users/orocrm/followers","following_url":"https://api.github.com/users/orocrm/following{/other_user}","gists_url":"https://api.github.com/users/orocrm/gists{/gist_id}","starred_url":"https://api.github.com/users/orocrm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/orocrm/subscriptions","organizations_url":"https://api.github.com/users/orocrm/orgs","repos_url":"https://api.github.com/users/orocrm/repos","events_url":"https://api.github.com/users/orocrm/events{/privacy}","received_events_url":"https://api.github.com/users/orocrm/received_events","type":"Organization","site_admin":false},"repo":{"id":16752895,"name":"documentation","full_name":"orocrm/documentation","owner":{"login":"orocrm","id":4165718,"avatar_url":"https://avatars.githubusercontent.com/u/4165718?v=3","gravatar_id":"","url":"https://api.github.com/users/orocrm","html_url":"https://github.com/orocrm","followers_url":"https://api.github.com/users/orocrm/followers","following_url":"https://api.github.com/users/orocrm/following{/other_user}","gists_url":"https://api.github.com/users/orocrm/gists{/gist_id}","starred_url":"https://api.github.com/users/orocrm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/orocrm/subscriptions","organizations_url":"https://api.github.com/users/orocrm/orgs","repos_url":"https://api.github.com/users/orocrm/repos","events_url":"https://api.github.com/users/orocrm/events{/privacy}","received_events_url":"https://api.github.com/users/orocrm/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/orocrm/documentation","description":"The Oro Platform and OroCRM Documentation","fork":false,"url":"https://api.github.com/repos/orocrm/documentation","forks_url":"https://api.github.com/repos/orocrm/documentation/forks","keys_url":"https://api.github.com/repos/orocrm/documentation/keys{/key_id}","collaborators_url":"https://api.github.com/repos/orocrm/documentation/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/orocrm/documentation/teams","hooks_url":"https://api.github.com/repos/orocrm/documentation/hooks","issue_events_url":"https://api.github.com/repos/orocrm/documentation/issues/events{/number}","events_url":"https://api.github.com/repos/orocrm/documentation/events","assignees_url":"https://api.github.com/repos/orocrm/documentation/assignees{/user}","branches_url":"https://api.github.com/repos/orocrm/documentation/branches{/branch}","tags_url":"https://api.github.com/repos/orocrm/documentation/tags","blobs_url":"https://api.github.com/repos/orocrm/documentation/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/orocrm/documentation/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/orocrm/documentation/git/refs{/sha}","trees_url":"https://api.github.com/repos/orocrm/documentation/git/trees{/sha}","statuses_url":"https://api.github.com/repos/orocrm/documentation/statuses/{sha}","languages_url":"https://api.github.com/repos/orocrm/documentation/languages","stargazers_url":"https://api.github.com/repos/orocrm/documentation/stargazers","contributors_url":"https://api.github.com/repos/orocrm/documentation/contributors","subscribers_url":"https://api.github.com/repos/orocrm/documentation/subscribers","subscription_url":"https://api.github.com/repos/orocrm/documentation/subscription","commits_url":"https://api.github.com/repos/orocrm/documentation/commits{/sha}","git_commits_url":"https://api.github.com/repos/orocrm/documentation/git/commits{/sha}","comments_url":"https://api.github.com/repos/orocrm/documentation/comments{/number}","issue_comment_url":"https://api.github.com/repos/orocrm/documentation/issues/comments{/number}","contents_url":"https://api.github.com/repos/orocrm/documentation/contents/{+path}","compare_url":"https://api.github.com/repos/orocrm/documentation/compare/{base}...{head}","merges_url":"https://api.github.com/repos/orocrm/documentation/merges","archive_url":"https://api.github.com/repos/orocrm/documentation/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/orocrm/documentation/downloads","issues_url":"https://api.github.com/repos/orocrm/documentation/issues{/number}","pulls_url":"https://api.github.com/repos/orocrm/documentation/pulls{/number}","milestones_url":"https://api.github.com/repos/orocrm/documentation/milestones{/number}","notifications_url":"https://api.github.com/repos/orocrm/documentation/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/orocrm/documentation/labels{/name}","releases_url":"https://api.github.com/repos/orocrm/documentation/releases{/id}","created_at":"2014-02-12T02:08:30Z","updated_at":"2015-07-29T21:10:36Z","pushed_at":"2015-08-04T18:12:28Z","git_url":"git://github.com/orocrm/documentation.git","ssh_url":"git@github.com:orocrm/documentation.git","clone_url":"https://github.com/orocrm/documentation.git","svn_url":"https://github.com/orocrm/documentation","homepage":"","size":25654,"stargazers_count":20,"watchers_count":20,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":29,"mirror_url":null,"open_issues_count":5,"forks":29,"open_issues":5,"watchers":20,"default_branch":"master"}},"base":{"label":"orocrm:master","ref":"master","sha":"a486da8ecf7f60dbff4e6c5bd45c63760c0b91eb","user":{"login":"orocrm","id":4165718,"avatar_url":"https://avatars.githubusercontent.com/u/4165718?v=3","gravatar_id":"","url":"https://api.github.com/users/orocrm","html_url":"https://github.com/orocrm","followers_url":"https://api.github.com/users/orocrm/followers","following_url":"https://api.github.com/users/orocrm/following{/other_user}","gists_url":"https://api.github.com/users/orocrm/gists{/gist_id}","starred_url":"https://api.github.com/users/orocrm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/orocrm/subscriptions","organizations_url":"https://api.github.com/users/orocrm/orgs","repos_url":"https://api.github.com/users/orocrm/repos","events_url":"https://api.github.com/users/orocrm/events{/privacy}","received_events_url":"https://api.github.com/users/orocrm/received_events","type":"Organization","site_admin":false},"repo":{"id":16752895,"name":"documentation","full_name":"orocrm/documentation","owner":{"login":"orocrm","id":4165718,"avatar_url":"https://avatars.githubusercontent.com/u/4165718?v=3","gravatar_id":"","url":"https://api.github.com/users/orocrm","html_url":"https://github.com/orocrm","followers_url":"https://api.github.com/users/orocrm/followers","following_url":"https://api.github.com/users/orocrm/following{/other_user}","gists_url":"https://api.github.com/users/orocrm/gists{/gist_id}","starred_url":"https://api.github.com/users/orocrm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/orocrm/subscriptions","organizations_url":"https://api.github.com/users/orocrm/orgs","repos_url":"https://api.github.com/users/orocrm/repos","events_url":"https://api.github.com/users/orocrm/events{/privacy}","received_events_url":"https://api.github.com/users/orocrm/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/orocrm/documentation","description":"The Oro Platform and OroCRM Documentation","fork":false,"url":"https://api.github.com/repos/orocrm/documentation","forks_url":"https://api.github.com/repos/orocrm/documentation/forks","keys_url":"https://api.github.com/repos/orocrm/documentation/keys{/key_id}","collaborators_url":"https://api.github.com/repos/orocrm/documentation/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/orocrm/documentation/teams","hooks_url":"https://api.github.com/repos/orocrm/documentation/hooks","issue_events_url":"https://api.github.com/repos/orocrm/documentation/issues/events{/number}","events_url":"https://api.github.com/repos/orocrm/documentation/events","assignees_url":"https://api.github.com/repos/orocrm/documentation/assignees{/user}","branches_url":"https://api.github.com/repos/orocrm/documentation/branches{/branch}","tags_url":"https://api.github.com/repos/orocrm/documentation/tags","blobs_url":"https://api.github.com/repos/orocrm/documentation/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/orocrm/documentation/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/orocrm/documentation/git/refs{/sha}","trees_url":"https://api.github.com/repos/orocrm/documentation/git/trees{/sha}","statuses_url":"https://api.github.com/repos/orocrm/documentation/statuses/{sha}","languages_url":"https://api.github.com/repos/orocrm/documentation/languages","stargazers_url":"https://api.github.com/repos/orocrm/documentation/stargazers","contributors_url":"https://api.github.com/repos/orocrm/documentation/contributors","subscribers_url":"https://api.github.com/repos/orocrm/documentation/subscribers","subscription_url":"https://api.github.com/repos/orocrm/documentation/subscription","commits_url":"https://api.github.com/repos/orocrm/documentation/commits{/sha}","git_commits_url":"https://api.github.com/repos/orocrm/documentation/git/commits{/sha}","comments_url":"https://api.github.com/repos/orocrm/documentation/comments{/number}","issue_comment_url":"https://api.github.com/repos/orocrm/documentation/issues/comments{/number}","contents_url":"https://api.github.com/repos/orocrm/documentation/contents/{+path}","compare_url":"https://api.github.com/repos/orocrm/documentation/compare/{base}...{head}","merges_url":"https://api.github.com/repos/orocrm/documentation/merges","archive_url":"https://api.github.com/repos/orocrm/documentation/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/orocrm/documentation/downloads","issues_url":"https://api.github.com/repos/orocrm/documentation/issues{/number}","pulls_url":"https://api.github.com/repos/orocrm/documentation/pulls{/number}","milestones_url":"https://api.github.com/repos/orocrm/documentation/milestones{/number}","notifications_url":"https://api.github.com/repos/orocrm/documentation/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/orocrm/documentation/labels{/name}","releases_url":"https://api.github.com/repos/orocrm/documentation/releases{/id}","created_at":"2014-02-12T02:08:30Z","updated_at":"2015-07-29T21:10:36Z","pushed_at":"2015-08-04T18:12:28Z","git_url":"git://github.com/orocrm/documentation.git","ssh_url":"git@github.com:orocrm/documentation.git","clone_url":"https://github.com/orocrm/documentation.git","svn_url":"https://github.com/orocrm/documentation","homepage":"","size":25654,"stargazers_count":20,"watchers_count":20,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":29,"mirror_url":null,"open_issues_count":5,"forks":29,"open_issues":5,"watchers":20,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/orocrm/documentation/pulls/160"},"html":{"href":"https://github.com/orocrm/documentation/pull/160"},"issue":{"href":"https://api.github.com/repos/orocrm/documentation/issues/160"},"comments":{"href":"https://api.github.com/repos/orocrm/documentation/issues/160/comments"},"review_comments":{"href":"https://api.github.com/repos/orocrm/documentation/pulls/160/comments"},"review_comment":{"href":"https://api.github.com/repos/orocrm/documentation/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/orocrm/documentation/pulls/160/commits"},"statuses":{"href":"https://api.github.com/repos/orocrm/documentation/statuses/baa4cb64a8c806149a8acc6ec4ee65cfc23d85b3"}}}}