{"action":"created","issue":{"url":"https://api.github.com/repos/vaadin/vaadin-grid-flow/issues/466","repository_url":"https://api.github.com/repos/vaadin/vaadin-grid-flow","labels_url":"https://api.github.com/repos/vaadin/vaadin-grid-flow/issues/466/labels{/name}","comments_url":"https://api.github.com/repos/vaadin/vaadin-grid-flow/issues/466/comments","events_url":"https://api.github.com/repos/vaadin/vaadin-grid-flow/issues/466/events","html_url":"https://github.com/vaadin/vaadin-grid-flow/issues/466","id":391889097,"node_id":"MDU6SXNzdWUzOTE4ODkwOTc=","number":466,"title":"Renderers not working","user":{"login":"ttsanton","id":7467196,"node_id":"MDQ6VXNlcjc0NjcxOTY=","avatar_url":"https://avatars1.githubusercontent.com/u/7467196?v=4","gravatar_id":"","url":"https://api.github.com/users/ttsanton","html_url":"https://github.com/ttsanton","followers_url":"https://api.github.com/users/ttsanton/followers","following_url":"https://api.github.com/users/ttsanton/following{/other_user}","gists_url":"https://api.github.com/users/ttsanton/gists{/gist_id}","starred_url":"https://api.github.com/users/ttsanton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ttsanton/subscriptions","organizations_url":"https://api.github.com/users/ttsanton/orgs","repos_url":"https://api.github.com/users/ttsanton/repos","events_url":"https://api.github.com/users/ttsanton/events{/privacy}","received_events_url":"https://api.github.com/users/ttsanton/received_events","type":"User","site_admin":false},"labels":[{"id":724712382,"node_id":"MDU6TGFiZWw3MjQ3MTIzODI=","url":"https://api.github.com/repos/vaadin/vaadin-grid-flow/labels/question","name":"question","color":"cc317c","default":true}],"state":"closed","locked":false,"assignee":{"login":"ttsanton","id":7467196,"node_id":"MDQ6VXNlcjc0NjcxOTY=","avatar_url":"https://avatars1.githubusercontent.com/u/7467196?v=4","gravatar_id":"","url":"https://api.github.com/users/ttsanton","html_url":"https://github.com/ttsanton","followers_url":"https://api.github.com/users/ttsanton/followers","following_url":"https://api.github.com/users/ttsanton/following{/other_user}","gists_url":"https://api.github.com/users/ttsanton/gists{/gist_id}","starred_url":"https://api.github.com/users/ttsanton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ttsanton/subscriptions","organizations_url":"https://api.github.com/users/ttsanton/orgs","repos_url":"https://api.github.com/users/ttsanton/repos","events_url":"https://api.github.com/users/ttsanton/events{/privacy}","received_events_url":"https://api.github.com/users/ttsanton/received_events","type":"User","site_admin":false},"assignees":[{"login":"ttsanton","id":7467196,"node_id":"MDQ6VXNlcjc0NjcxOTY=","avatar_url":"https://avatars1.githubusercontent.com/u/7467196?v=4","gravatar_id":"","url":"https://api.github.com/users/ttsanton","html_url":"https://github.com/ttsanton","followers_url":"https://api.github.com/users/ttsanton/followers","following_url":"https://api.github.com/users/ttsanton/following{/other_user}","gists_url":"https://api.github.com/users/ttsanton/gists{/gist_id}","starred_url":"https://api.github.com/users/ttsanton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ttsanton/subscriptions","organizations_url":"https://api.github.com/users/ttsanton/orgs","repos_url":"https://api.github.com/users/ttsanton/repos","events_url":"https://api.github.com/users/ttsanton/events{/privacy}","received_events_url":"https://api.github.com/users/ttsanton/received_events","type":"User","site_admin":false}],"milestone":null,"comments":1,"created_at":"2018-12-17T21:04:38Z","updated_at":"2018-12-18T14:11:06Z","closed_at":"2018-12-18T14:11:06Z","author_association":"NONE","body":"_Running on 12.0.3_\r\n\r\nI have a Grid that gets values with a ListDataProvider.\r\n\r\n```\r\nGrid<Apps> grid = new Grid<>();\r\nSet<Apps> appList = getRatings();\r\nListDataProvider<Apps> listDataProvider = new ListDataProvider<>(appList);\r\n\r\ngrid.setDataProvider(listDataProvider);\r\n```\r\n\r\nI include IconRenderers and TextRenderers for some of the columns for my grid. \r\n\r\n```\r\ngrid.addColumn(new IconRenderer<>(\r\n\tapplication -> (application.getCv() != null && !application.getCv().isEmpty())\r\n\t\t\t\t? new Icon(VaadinIcon.CHECK_SQUARE)\r\n\t\t\t\t: new Icon(VaadinIcon.THIN_SQUARE),\r\n\t\t\t\tapplication -> \"\"), \"cv_url\")\r\n    .setHeader(\"CV\").setWidth(wdSmall).setSortable(true);\r\n\r\ngrid.addColumn(new IconRenderer<>( \r\n\t\tapplication -> (application.getPs_url() != null && !application.getPs_url().isEmpty())\r\n\t\t\t\t? new Icon(VaadinIcon.CHECK_SQUARE)\r\n\t\t\t\t: new Icon(VaadinIcon.THIN_SQUARE),\r\n\t\tapplication -> \"\"), \"ps_url\")\r\n\t.setHeader(\"PS\").setWidth(wdSmall);\r\n\r\ngrid.addColumn(new IconRenderer<>(\r\n\t\tapplication -> (application.getLor_url() != null && !application.getLor_url().isEmpty())\r\n\t\t\t\t? (application.getLor_url().equals(\"N/A\")) ? new Icon(VaadinIcon.RASTER)\r\n\t\t\t\t\t\t: new Icon(VaadinIcon.CHECK_SQUARE)\r\n\t\t\t\t: new Icon(VaadinIcon.THIN_SQUARE)))\r\n\t.setHeader(\"LoR\").setWidth(wdSmall).setSortable(true);\r\n```\r\n\r\nHowever, when the page loads, the Renderer does not show up right away:\r\n\r\n![screen shot 2018-12-17 at 3 55 48 pm](https://user-images.githubusercontent.com/7467196/50115035-3f882800-0214-11e9-9dac-e2982da45480.png)\r\n\r\nIf I force the Grid to sort, it will show up, but still with errors:\r\n![screen shot 2018-12-17 at 3 56 38 pm](https://user-images.githubusercontent.com/7467196/50115080-621a4100-0214-11e9-8448-22ea3ba2a076.png)\r\n\r\nI tried with using a normal setItems() call for the Grid, but the same results happen.\r\n\r\nI also added some print statements to check and see when the Renderers are actually being used, and they are not triggered until after I manually sort the grid or if I scroll down further down a Grid with lots of rows, forcing it to load in more items.\r\n"},"comment":{"url":"https://api.github.com/repos/vaadin/vaadin-grid-flow/issues/comments/448233225","html_url":"https://github.com/vaadin/vaadin-grid-flow/issues/466#issuecomment-448233225","issue_url":"https://api.github.com/repos/vaadin/vaadin-grid-flow/issues/466","id":448233225,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0ODIzMzIyNQ==","user":{"login":"ttsanton","id":7467196,"node_id":"MDQ6VXNlcjc0NjcxOTY=","avatar_url":"https://avatars1.githubusercontent.com/u/7467196?v=4","gravatar_id":"","url":"https://api.github.com/users/ttsanton","html_url":"https://github.com/ttsanton","followers_url":"https://api.github.com/users/ttsanton/followers","following_url":"https://api.github.com/users/ttsanton/following{/other_user}","gists_url":"https://api.github.com/users/ttsanton/gists{/gist_id}","starred_url":"https://api.github.com/users/ttsanton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ttsanton/subscriptions","organizations_url":"https://api.github.com/users/ttsanton/orgs","repos_url":"https://api.github.com/users/ttsanton/repos","events_url":"https://api.github.com/users/ttsanton/events{/privacy}","received_events_url":"https://api.github.com/users/ttsanton/received_events","type":"User","site_admin":false},"created_at":"2018-12-18T14:11:06Z","updated_at":"2018-12-18T14:11:06Z","author_association":"NONE","body":"@denis-anisimov , I have been able to fix the problem I had with the renderers initially not showing up on the Grid.\r\n\r\nI don't know how to fully explain in detail, but I am working with a set of data that can hold a variable amount of columns and needs to be updated based on a ComboBox selection. As a result, I needed to use the Renderers as a way to \"match\" information into the respective rows. \r\nIn Vaadin 7, I was able to achieve this by creating a version of the addRow() method that worked with my data, but this Vaadin version requires me to use the Renderers as a way to associate the correct information to its repective rows.\r\n\r\nI thought I could achieve this by loading in the ListDataProvider to the same grid each time and just re-create the columns using this code snippet:\r\n```\r\n//remove all columns and re-build\r\nfor(Column<Apps> c : columns)\r\n\tgrid.removeColumn(c);\r\n\r\ngrid.addColumn(...)\r\n... \r\n//re-fill the columns for the grid\r\n```\r\nBut, it appears that I need to create a new grid each time, since the number of columns I might have can change."}}
{"actor":{"display_login":"ttsanton"}}