<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Retrieve Formatting objects for tableDataView Rows in Custom Visuals Development Discussion</title>
    <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Retrieve-Formatting-objects-for-tableDataView-Rows/m-p/3119772#M7031</link>
    <description>&lt;P&gt;Hey guys,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to get formatting objects for rows in a table dataView.&lt;BR /&gt;First, I create a row selector and add it to the transformed model.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;let eventSelection = this.host.createSelectionIdBuilder()
   .withTable(tableDataView, j)
   .createSelectionId();&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also I create colors for each selected row:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;let color;
if(this.sett.colors.autoColor.value) {
	color = colors[j];
} else if(this.sett.colors.isSingleColor.value) {
	color = this.sett.colors.defaultColor.value;
} else if(tableDataView.rows[j].objects) {
	color = tableDataView.rows[j].objects["colors"]["eventColor"]["solid"]["color"]
} else {
	color = colors[j]
}

let ids;
roles.forEach(r=&amp;gt; {
	let role = r.role;
	if(role == "events") {
		let val = tableDataView.rows[j][r.index];
		ids = {"selection": eventSelection, "event": val, "color": color};
	}
})
dv.id.push(ids);&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;Then, I populate the enumerateObjectInstances format bar&amp;nbsp;in the following way:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;case 'colors':
	if(this.allData) {
		for(let row of this.allData.id) {
			properties.push({
				objectName: propertyGroupName,
				displayName: row.event,
				properties: {
					eventColor: row.color
				},
				selector: row.selection.getSelector()
			})
		}
			
	}
break;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The formatting options appear fine, I take the values of the rows of one of the columns as the displayed values.&lt;BR /&gt;The problem is that when choosing a color for my "rows" I don't see these objects in the dataView. That is, I assume that they should appear somewhere here -&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;tableDataView.rows[i].objects&lt;/LI-CODE&gt;&lt;P&gt;but there is nothing there.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The selectors show the correct identityIndex , but there are no objects in the model for them.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Result of row&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;selection&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;getSelector&lt;/SPAN&gt;&lt;SPAN&gt;():&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="customvisuals_0-1678305294275.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/883465iCF59CE42D9343F42/image-size/medium?v=v2&amp;amp;px=400" role="button" title="customvisuals_0-1678305294275.png" alt="customvisuals_0-1678305294275.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;dataView&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="customvisuals_1-1678305454249.png" style="width: 999px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/883466i62B565E6F6BC63D5/image-size/large?v=v2&amp;amp;px=999" role="button" title="customvisuals_1-1678305454249.png" alt="customvisuals_1-1678305454249.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Formating panel:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="customvisuals_2-1678305593846.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/883467iCAD72239E241EB6B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="customvisuals_2-1678305593846.png" alt="customvisuals_2-1678305593846.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 08 Mar 2023 20:00:07 GMT</pubDate>
    <dc:creator>custom-visuals</dc:creator>
    <dc:date>2023-03-08T20:00:07Z</dc:date>
    <item>
      <title>Retrieve Formatting objects for tableDataView Rows</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Retrieve-Formatting-objects-for-tableDataView-Rows/m-p/3119772#M7031</link>
      <description>&lt;P&gt;Hey guys,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to get formatting objects for rows in a table dataView.&lt;BR /&gt;First, I create a row selector and add it to the transformed model.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;let eventSelection = this.host.createSelectionIdBuilder()
   .withTable(tableDataView, j)
   .createSelectionId();&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also I create colors for each selected row:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;let color;
if(this.sett.colors.autoColor.value) {
	color = colors[j];
} else if(this.sett.colors.isSingleColor.value) {
	color = this.sett.colors.defaultColor.value;
} else if(tableDataView.rows[j].objects) {
	color = tableDataView.rows[j].objects["colors"]["eventColor"]["solid"]["color"]
} else {
	color = colors[j]
}

let ids;
roles.forEach(r=&amp;gt; {
	let role = r.role;
	if(role == "events") {
		let val = tableDataView.rows[j][r.index];
		ids = {"selection": eventSelection, "event": val, "color": color};
	}
})
dv.id.push(ids);&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;Then, I populate the enumerateObjectInstances format bar&amp;nbsp;in the following way:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;case 'colors':
	if(this.allData) {
		for(let row of this.allData.id) {
			properties.push({
				objectName: propertyGroupName,
				displayName: row.event,
				properties: {
					eventColor: row.color
				},
				selector: row.selection.getSelector()
			})
		}
			
	}
break;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The formatting options appear fine, I take the values of the rows of one of the columns as the displayed values.&lt;BR /&gt;The problem is that when choosing a color for my "rows" I don't see these objects in the dataView. That is, I assume that they should appear somewhere here -&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;tableDataView.rows[i].objects&lt;/LI-CODE&gt;&lt;P&gt;but there is nothing there.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The selectors show the correct identityIndex , but there are no objects in the model for them.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Result of row&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;selection&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;getSelector&lt;/SPAN&gt;&lt;SPAN&gt;():&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="customvisuals_0-1678305294275.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/883465iCF59CE42D9343F42/image-size/medium?v=v2&amp;amp;px=400" role="button" title="customvisuals_0-1678305294275.png" alt="customvisuals_0-1678305294275.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;dataView&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="customvisuals_1-1678305454249.png" style="width: 999px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/883466i62B565E6F6BC63D5/image-size/large?v=v2&amp;amp;px=999" role="button" title="customvisuals_1-1678305454249.png" alt="customvisuals_1-1678305454249.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Formating panel:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="customvisuals_2-1678305593846.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/883467iCAD72239E241EB6B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="customvisuals_2-1678305593846.png" alt="customvisuals_2-1678305593846.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Mar 2023 20:00:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Retrieve-Formatting-objects-for-tableDataView-Rows/m-p/3119772#M7031</guid>
      <dc:creator>custom-visuals</dc:creator>
      <dc:date>2023-03-08T20:00:07Z</dc:date>
    </item>
  </channel>
</rss>

