cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Regular Visitor

Cannot add a property to Format->general

Okay I am new to all this and have now spent many hours now trying to fix this problem to no avail. I think its about time I hear if the community has any suggestion.

 

I am currently writing some custom additions to the Gannt visual (can be found here).

 

One of those additions is the ability to sort the gantt by name rather than startdate. I have written some code that looks to be working and now I want a boolean property under format->generel such that the user can turn this ON/OFF. I added the following to capabilities.json under objects-> general -> properties.

*Notice that I am including the "groupTasks" property above which was in the file to begin with and was used as a refference. 

 

"groupTasks": {
                    "displayName": "Group Tasks",
                    "displayNameKey": "Visual_GroupTasks",
                    "type": {
                        "bool": true
                    }
                },
"sortByName": {
                    "displayName": "Sort by name",
                    "displayNameKey": "Visual_SortTasks",
                    "type": {
                        "bool": false
                    }
                }

Then added the following to resources.resjson

 

 

"Visual_GroupTasks": "Group Tasks",
"Visual_SortTasks": "Sort by name",

 

 

This visual uses DataViewObjectsParser for processing the above and give a model accesable by the rest of the code. I added sortByName here as well in settings.ts.

 

    export class GeneralSettings {
        groupTasks: boolean = false;
		sortByName: boolean = false;
        scrollToCurrentTime: boolean = false;
        durationUnit: string = "day";
        durationMin: number = 1;
    }

Now when I search  for "grouptasks", I find that the only other place it was used was as a method under the main file gantt.ts and when it was referenced in the GeneralSettings model above. I therefore cannot see what I am missing. I have tried making an equalent of any mention of groupTasks in all files, but with the name of sortByName, but it still won't appear under format->general in PowerBI desktop..

 

Any ideas?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Regular Visitor

Re: Cannot add a property to Format->general

I found the issue by complete chance, Apparently type must not be false (I thought it was default value) in type in capabilities, so it must be defined like.

 

                "sortByName": {
                    "displayName": "Sort by name",
                    "displayNameKey": "Visual_SortTasks",
                    "type": {
                        "bool": true
                    }
                },

Now it appears

View solution in original post

7 REPLIES 7
Highlighted
Community Champion
Community Champion

Re: Cannot add a property to Format->general

Hello @patr0805

 

You must include "sortByName" into capabilities.json.

Please take a look at the documentation to find out more.

 

Ignat Vilesov,

Software Engineer

 

Microsoft Power BI Custom Visuals

pbicvsupport@microsoft.com

 

Highlighted
Regular Visitor

Re: Cannot add a property to Format->general

As written in my first message, its already included in capabilities.json. I am currently reading your link regarding DataViewObjectsParser as I suspect that there is something strange I am missing.

Highlighted
Regular Visitor

Re: Cannot add a property to Format->general

I found the issue by complete chance, Apparently type must not be false (I thought it was default value) in type in capabilities, so it must be defined like.

 

                "sortByName": {
                    "displayName": "Sort by name",
                    "displayNameKey": "Visual_SortTasks",
                    "type": {
                        "bool": true
                    }
                },

Now it appears

View solution in original post

Highlighted
New Member

Re: Cannot add a property to Format->general

Hello - it seems that the Gantt visual is now (in the last couple of weeks) sorting the data by Task as a default.  It used to be by Start Date.  I'm a newbie at customizing but is there a quick way to get back to sorting by Start Date?

 

Thanks.

Highlighted
New Member

Re: Cannot add a property to Format->general

Hello - it seems that the Gantt visual is now (in the last couple of weeks) sorting the data by Task as a default.  It used to be by Start Date.  I'm a newbie at customizing but is there a quick way to get back to sorting by Start Date?

 

Thanks.

Highlighted
Community Champion
Community Champion

Re: Cannot add a property to Format->general

Hello @kiliman

 

You can change the default sort order by clicking "..." (3 dots) in the right top corner of Gantt Chart.

After that you will be able to change sort order as you want.

image.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Ignat Vilesov,

Software Engineer

 

Microsoft Power BI Custom Visuals

pbicvsupport@microsoft.com

Highlighted
New Member

Re: Cannot add a property to Format->general

Thank you! That was a Doh! moment.  Appreciate it...

Helpful resources

Announcements
Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Using the Community

Using the Community

Need help with the Power BI Community? Our 'Using the Community' support articles are a great place to start.

Galleries

Galleries

Looking for inspiration on how to present your data? Need instructional videos? Check out our Galleries!

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors