cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Bhuvita Helper II
Helper II

Re: Showing View Selector and Command bar on Subgrid Custom Compnonent

@AnqiChen @ScottDurow 

 

I tried to use the approach Scott suggest and it works correctly for alphabets and All keyword but for # it doesn't seems to work. Below is my code.

 

Where char is alphabet letter.

 

  var condition = null;
            if (char == "#") {
                let alphabets: string[]  = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"];
                condition = {
                    attributeName: "name",
                    conditionOperator: 8, //
                    value: alphabets,
                    entityAliasName: "opportunity",
                };
            }
            else {
                char = char + "%";
                condition = {
                    attributeName: "name",
                    conditionOperator: 6, //
                    value: char,
                    entityAliasName: "opportunity",
                };
            }
            const conditionArray = [];
            conditionArray.push(condition);
            this.contextObj.parameters.sampleDataSet.filtering.setFilter({
                // @ts-ignore
                conditions: conditionArray,
                filterOperator: 1, // Or
            });
            this.contextObj.parameters.sampleDataSet.refresh();

 

What am I doing wrong here ?

 

I also tried to use the keyword displayIndex:true and indeed it display the bar at the right side so as of now we can't use it.

Re: Showing View Selector and Command bar on Subgrid Custom Compnonent

I think the issue is that you are using the 'in' operator on the list of numbers - but actually you need to still use the like:

let alphabets: string[]  = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"];
                condition = {
                    attributeName: "name",
                    conditionOperator: 8, //
                    value: alphabets,
                    entityAliasName: "opportunity",
                };

 

This will only match opportunities that have a name EXACTLY equal to 1,2,3...

I would use the same approach you are using for the like - but add a list of conditions that are grouped in a filter OR group:

 

{
        "filterOperator": 1, // OR
	"conditions": [
		{
			"attributeName": "fullname",
			"conditionOperator": 6, // LIKE
			"value": "0%"
		},
		{
			"attributeName": "fullname",
			"conditionOperator": 6, // LIKE
			"value": "1%"
		},
		{
			"attributeName": "fullname",
			"conditionOperator": 6, // LIKE
			"value": "2%"
		},
		{
			"attributeName": "fullname",
			"conditionOperator": 6, // LIKE
			"value": "3%"
		}
		...
	]
}

 

Bhuvita Helper II
Helper II

Re: Showing View Selector and Command bar on Subgrid Custom Compnonent

@ScottDurow 

Yes I do tried with IN condition and array but this doesn't work .I was in assumption that it will take array directly.

 

let alphabets: string[]  = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"];
                condition = {
                    attributeName: "name",
                    conditionOperator: 6, //
                    value: alphabets,
                    entityAliasName: "opportunity",
                };

 

But after looping through list of condition not just passing the array it works.

 let numbers: string[] = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"];
                for (var num of numbers) {
                    num = num + "%";
                    condition = {
                        attributeName: "name",
                        conditionOperator: 6, // Equal or Under
                        value: num,
                        entityAliasName: "opportunity",
                    };
                    conditionArray.push(condition);
                }

 

Thanks for your response.

Highlighted
MVP

Re: Showing View Selector and Command bar on Subgrid Custom Compnonent

@AnqiChen @HemantG  can you confirm that this cds-data-set-options setting of dataset works in subgrids? I tried different combinations and nothing worked fine for me. I use CLI v1.1.6 and CDS v9.1.0000.10743. Here is piece of my manifest file:

<data-set name="exampleDataSet" display-name-key="exampleDataSet" cds-data-set-options="displayCommandBar:true;displayViewSelector:true;displayQuickFindSearch:true">
</data-set>
Power Apps
Power Apps

Re: Showing View Selector and Command bar on Subgrid Custom Compnonent

hi ,

 

Yes they should work well for subgrid. It might not show in CLI, but should show in product.

For ViewSelector and QuickFindSearch, u might need also to enable them in the form designer.

 

Also, the <data-set> should be the first property in the whole control.

 

 
 
MVP

Re: Showing View Selector and Command bar on Subgrid Custom Compnonent

@AnqiChen then I have an issue to report. I can confirm that I do have that setting in the dataset tag set and dataset is the first property in the manifest file. Also I can confirm that I have viewsector enabled in the subgrid with one different that I use "Selected Views" option instead of "All Views". Should I check anything else?

Power Apps
Power Apps

Re: Showing View Selector and Command bar on Subgrid Custom Compnonent

hi,

 

I test it myself and it seems workable right now.

Attached is the sample app solution that contains one PCF control, and the form with the PCF control. The app is 'TestAppForDataSet'.

 

Once you import the solution, just create a new record through 'New' and then Save. You should see Commandbar/ViewSelector/QuickFind there.

 

I am not sure about the issue at your environment, it could be:

1) The cds-data-set-options should be "displayCommandBar:true;displayViewSelector:true;displayQuickFind:true". It's displayQuickFind, not displayQuickFindSearch.

I am not sure if this is the issue, if this is the issue, it definitely is our bug

2) Or the environment is legacy? what's the build version of the environment? is it an OnPrem environment?

 

If still have issue, please let us know or create a ticket to us. So we could check in details.

 

 

MVP

Re: Showing View Selector and Command bar on Subgrid Custom Compnonent

@AnqiChen I was finally able to play with it myself and here are my results:

1. When you set the custom dataset control as a default one to be shown - view selector and search box are shown properly.

2. When I use default view (standard grid) and switch to custom control after - view selector and search box disappear. For me it looks like a bug.

cc: @HemantG 

Power Apps
Power Apps

Re: Showing View Selector and Command bar on Subgrid Custom Compnonent

@a33ik 

 

1) Thanks for reporting the issue. I am able to reproduce at my end

 

2) Our current stage is that the ViewSelector/QuickFind... as others, they need to go with the first rendered control before any 'ShowAs'.

 

For example, suppose the first rendered control is ControlA, then using 'ShowAs', we could switch to 'ControlB'. Then if 'ControlA' is not compatible with things like 'ViewSelector', then 'ControlB' won't show 'ViewSelector'

 

This is to prevent any confusion that suppose for the inititial view is

1) View 1 / Control A, then click 'ShowAs' to switch to Control B, then

2) View 1 / Control B, then use view selector to go to View 2

3) View 2/ Control B, then if we use 'ShowAs' to go back to 'ControlA', then

4) View 1/ControlA, or View 2/ControlA?

At this moment, as the ControlA could not see any view, it might have some confusion.

If we show View1, then the previous stage is View2

If we show View2, then at very initial stage, it is View1. should it be idempotent after these series of switchs?

 

In order to avoid any change, then we make it honor the first control's setting.

 

3) We do have a bug that our ReadonlyGrid/EditableGrid manifest does not claim they are compatible with quickFind/ViewSelector. Those are added by some hard-coded logic but its metadata does not claim it. If it switch to other controls, other controls will go with the ReadonlyGrid/EditableGrid setting so far.

We open a bug internally to update the metadata to make them compatible

 

 

 

 

Helpful resources

Announcements
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

Users online (8,069)