سؤال

I've discovered a strange behavior. I've generated a list which I customized a lot among other things using a .js file which I added to the JSLink field of the web part.

The list is working perfectly fine and all the JavaScript stuff working as expected.

I went to the list settings and save the list template using Save list as template and checked the "Include Content" box.

Now I'm able to add this list via the Site Contents >> add an app function to other sites. The list will be imported and is working as expected including all the JavaScript functions.

BUT when I go to an site and choose the "edit page" option and add this list as a webpart, the JavaScript part is not working anymore due to under "edit web part" the JSLink property is not set anymore.

Is there any way to add the "imported" list as a web part including all properties?

PS: When I export the list as a web part, the list does not contain any content anymore. So this isn't an option either.

هل كانت مفيدة؟

المحلول

You have to provide js file URL in JSLink property each time while adding your list view web part on the page. List and the list view web part are not the same thing.

Saving the list as a template will give you the functionality of generating the same list with same columns and also with including data but will not include list view web part. List view web part and the list are two completely different thing.

When you create a list or library on your site, a List View Web Part of the same name as the list or library is automatically created. When you create a new site from a site template, Web Parts are automatically added to the site home page. For example, a team site includes Announcements, Calendar, and Links Web Parts. These Web Parts are instances of the List View Web Part that use a pre-configured list template to display list data.

You can get more info about List View Web Part from here.

About List template

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى sharepoint.stackexchange
scroll top