How difficult would it be to add additional columns to the new releated data dialog grids?
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.
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
);
relatedDataGridOptions.visibleColumnKeys = [
"AllowMultiple"
,
this
.options.relatedTypeIdentifierField,
"LastModified"
,
"Owner"
,
"Edit"
,
"Preview"
];
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?
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