How difficult would it be to add additional columns to the n

Posted by Community Admin on 04-Aug-2018 17:40

How difficult would it be to add additional columns to the new releated data dialog grids?

All Replies

Posted by Community Admin on 08-May-2014 00:00

The default grids show title, owner, modified and a view, edit, delete column.  I looked advanced settings and could not find anywhere where those would be exposed.  Looking through JustDecompile I found a few ascx and javascript templates using Kendo for related data, but it looks like I would need to override these files in quite a few spots.

 Is this something easier than what I am making it out to be?

 For instance I want to expose one of my modules fields to display in a column.

Posted by Community Admin on 13-May-2014 00:00

Hi Stacey,

The RelatedDataField control is relatively new and for the time being it is not easily extensible. You would start by overriding the field control and extending its client side:

http://www.sitefinity.com/blogs/pavel-benov-s-blog/2013/12/11/extending-client-component-of-field-controls-in-sitefinity-cms

In the Initialize function of the script we are using requireJs to reference the additional templates and scripts needed to power the related data grid in the dialog that pops up:

requirejs.config(
            baseUrl: this._siteBaseUrl + "Res",
            paths:
                RelatedDataSelector: 'Telerik.Sitefinity.RelatedData.Web.UI.Scripts.RelatedDataSelector',
                RelatedDataGrid: 'Telerik.Sitefinity.RelatedData.Web.UI.Scripts.RelatedDataGrid',
 
                RelatedDataSelectorTemplate: 'Telerik.Sitefinity.RelatedData.Web.UI.Templates.RelatedDataSelector.sfhtml',
                RelatedDataGridTemplate: 'Telerik.Sitefinity.RelatedData.Web.UI.Templates.RelatedDataGrid.sfhtml',
 
                ContentSelectorBase: 'Telerik.Sitefinity.RelatedData.Web.UI.Scripts.ContentSelectorBase',
                FlatContentSelector: 'Telerik.Sitefinity.RelatedData.Web.UI.Scripts.FlatContentSelector',
                FlatContentSelectorTemplate: 'Telerik.Sitefinity.RelatedData.Web.UI.Templates.FlatContentSelector.sfhtml',
 
                DetailViewEditingWindow: 'Telerik.Sitefinity.Web.RequireJSModules.Scripts.DetailViewEditingWindow',
                ContentRepository: 'Telerik.Sitefinity.Web.UI.PublicControls.InlineEditing.Scripts.ContentRepository'
            ,
            map:
                '*':
                    text: this._siteBaseUrl + "ExtRes/Telerik.Sitefinity.Resources.Scripts.RequireJS.text.js",
                
            ,
            waitSeconds: 0
        );

The RelatedDataGrid.sfhtml is the template of the grid control which you need to customize and add a custom column.

The RelatedDataSelect is the javascript file that powers this grid and where you need to set the visible columns of the grid you would like:

relatedDataGridOptions.visibleColumnKeys = ["AllowMultiple", this.options.relatedTypeIdentifierField, "LastModified", "Owner", "Edit", "Preview"];

All this however would not work without extending the 2 services (GenericDataService and RelatedDataService) that deliver the dynamic data to the grid. Currently those services bring only standard fields like Owner, DateCreated, Url etc. and they lack implementation to transfer custom fields data.

Regards,
Pavel Benov
Telerik
 
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
 

Posted by Community Admin on 13-May-2014 00:00

I thought that might be the case.  Thanks for getting back to me with the information you posted.  I am making the assumption, assuming other developers have a need for this, that additional iterations of the new related data functionality will eventually expose an easier way to extend those grids?

Posted by Community Admin on 14-May-2014 00:00

Hello Stacey,

Yes, there are plans for further enhancing the control and making it more extensible, but for the time being I cannot provide any estimates. On a side note we are going to work on a sample and post an online resource that will provide more details on extending the control.

Regards,
Pavel Benov
Telerik

 
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
 

This thread is closed