Hi,
is it possible (or is it planned for) to create a PCF control for a particular subgrid column?
The scenario is: I don't really want to recreate the whole subgrid (paging, scrolling, command bar, save functionality), but, possibly, I just want one (or more) specific fields in that subgrid to use a custom control.
Thanks,
Alex
Solved! Go to Solution.
Hi Alex,
This attribute "cds-data-set-options" is not exposed to external users yet. That's why tooling blocks it now. To unblock yourself, you can change the json schema as you proposed so that local builds can proceed.
The tooling may continue to block any properties or attributes that are not valid or not exposed to public because we want to catch potential typos or wrong uses of attributes in the manifest at build stage. Having said that, we will definitely take note of your feedbacks.
Thank you. Hope that helps.
Frank Chen
Currently the columns specifically cannot be chosen and replaced by custom components specifically. This will be enabled in future but is not on the immediate roadmap.
For the custom control data set supports the views, search, commanding and pagning at the framework level. Check out the samples and demos at https://aka.ms/PCFdemos along with the ones shared as part of samples for preview - https://docs.microsoft.com/en-us/powerapps/developer/component-framework/sample-controls/table-grid-...
Thanks,
Hemant
Hi Hemant,
thank you for the answer. That's exactly the sample I used to create a grid where I only wanted to show a checkbox(or some kind of switch) for the two-options fields.
It seems (unless I'm missing something), the pagination, search, etc have to be added to the HTML from within the control script, and the same goes for the regular subgrid commands (activate/deactivate/delete/add new/etc). That's what I was asking about - if we could get at least that so we would only have to rewrite the grid itself... Anyway, just a thought.
Thanks,
Alex
hi ashlega,
For subgrid on form, you should get Commandbar/ViewSelector/QuickFindSearch/Jumpbar by free. Here is the way,
Suppose you have a data set control, its manifest xml node is like
<data-set name=”foo” >
.....
<data-set/>
Then all you need is to
1) Update manifest version
2) Update that node and add attribute cds-data-set-options=”displayCommandBar:true;displayViewSelector:true;displayquickfind:true”
It will look like
<data-set name=”foo” cds-data-set-options=”displayCommandBar:true;displayViewSelector:true;displayQuickFind:true”>
.....
<data-set/>
Hi @AnqiChen ,
thank you for those details. Was just trying to do this, and got the error below:
Manifest validation error: instance.manifest.control[0].data-set[0].$ additionalProperty "cds-data-set-options" exists in instance when not allowed
The definition is like this:
<data-set name="tableGrid" display-name-key="Table Grid" cds-data-set-options="displayCommandBar:true;displayViewSelector:false;displayQuickFind:true">
</data-set>
Does it tell you anything?
Thanks,
Alex
Hi @AnqiChen
here is the remaining piece of the output log - it's npm run build which is failing:
**********************************************************************
npm run build -- --noColor --buildmode development --outDir
C:\git\ITAintBoring.PCFControls\Controls\CheckBoxList\out
\controls\\
> pcf-project@1.0.0 build C:\git\ITAintBoring.PCFControls\Controls\CheckBoxList
> pcf-scripts build "--noColor" "--buildmode" "development" "--outDir" "C:\git\ITAintBoring.PCFControls\Controls\Chec
kBoxList\out\controls\\"
[6:42:20] [build] Initializing...
[6:42:20] [build] Validating manifest...
[6:42:20] [build] Failed:
C:\Users\shlegaal\.nuget\packages\microsoft.powerapps.msbuild.pcf\0.2.59\build\Microsoft.PowerApps.MSBuild.Pcf.targets(
22,3): error : [pcf-1014] [Error] Manifest validation error: instance.manifest.control[0].data-set[0].$ additionalPrope
rty "cds-data-set-options" exists in instance when not allowed [C:\git\ITAintBoring.PCFControls\Controls\CheckBoxList\C
heckBoxList.pcfproj]
C:\Users\shlegaal\.nuget\packages\microsoft.powerapps.msbuild.pcf\0.2.59\build\Microsoft.PowerApps.MSBuild.Pcf.targets(
22,3): error MSB3073: The command "npm run build -- --noColor --buildmode development --outDir C:\git\ITAintBoring.PCFC
ontrols\Controls\CheckBoxList\out\controls\\" exited with code -1. [C:\git\ITAintBoring.PCFControls\Controls\CheckBoxLi
st\CheckBoxList.pcfproj]
Done Building Project "C:\git\ITAintBoring.PCFControls\Controls\CheckBoxList\CheckBoxList.pcfproj" (default targets) --
FAILED.
**********************************************************************
Hi @AnqiChen
it was coming from npm run build
But I just realized what I need to look for - turned out Manifestschema.json (which is in the node_modules\pcf-scripts subfolder) had this:
"dataSetAttribs": {
"type": "object",
"properties": {
"name": { "type": "string" },
"display-name-key": { "type": "string" },
"description-key": { "type": "string" }
},
"required": ["name", "display-name-key"],
"additionalProperties": false
},
Replacing "false" above with "true" did the trick and those additional properties you mentioned in your reply are accepted now.
Will it be supported? ("additionalProperties": true)
Thanks,
Alex
Hi Alex,
This attribute "cds-data-set-options" is not exposed to external users yet. That's why tooling blocks it now. To unblock yourself, you can change the json schema as you proposed so that local builds can proceed.
The tooling may continue to block any properties or attributes that are not valid or not exposed to public because we want to catch potential typos or wrong uses of attributes in the manifest at build stage. Having said that, we will definitely take note of your feedbacks.
Thank you. Hope that helps.
Frank Chen
Hi,
I have an existing PCF which has the same code to display the command bar for sub-grid.
<data-set name="dataset" display-name-key="Dataset" cds-data-set-options="displayCommandBar:true;displayViewSelector:true;displayquickfind:true">
I attached the same PCF to a view on a dashboard but the command bar and view selector are not displayed. Is there anything I'm missing?
Thank you.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.
User | Count |
---|---|
10 | |
8 | |
5 | |
3 | |
2 |