1

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 while adding as a list view webpart on the page. There is no OOTB option for it. – Dikesh Gandhi Jun 30 '16 at 12:19
  • are there may other approaches like exporting the list incl. content? – user1234 Jun 30 '16 at 12:40
4

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.