Question

aamirghanchi on Sat, 20 Aug 2016 20:08:16


I have some css and jquery customizations that need to be done before a NewForm.aspx of a custom list is rendered to the client. The changes work fine for a regular PC/Desktop view, but not available when in Mobile view. I have tried customization both using a script editor webpart and JSLink, but to no effect. I don't want to simply disable mobile view for the whole site just to resolve this issue. How can I make the customization work on mobile view?

Sponsored



Replies

Lakshmanan Sethu on Sun, 21 Aug 2016 04:44:38


Here you go

http://stackoverflow.com/questions/4896708/how-to-customize-sharepoint-2010-mobile-view

Murugesa Pandian on Sun, 21 Aug 2016 09:54:46


Hi,

Have you activated the feature "Enable Mobile Browser" feature  on your team site ?

Its my sharepoint that access through my Windows Phone Lumia 1520 with my WiFi before activating the above feature.

The same site view after activating the feature.

aamirghanchi on Mon, 22 Aug 2016 02:27:13


Thank you Lakshmanan, but I am not working with Visual Studio. This is all client side rendering using jquery/javascript and css.

aamirghanchi on Mon, 22 Aug 2016 02:30:26


Yes Murugesa, we do have mobile browser feature activated, and that is part of the problem. Perhaps not having mobile view would have been better for this page, but I cannot just turn this feature off just to make this page work. 

Thanks.

Murugesa Pandian on Mon, 22 Aug 2016 08:36:22


Hi aamirghanchi,

I am able to add the script to the list's newform.aspx page's AdditionalPageHeader placeholder through SPD and its executing in Mobile view too. Please ensure you are not placing the script in wrong placeholder.

Victoria Xia on Mon, 22 Aug 2016 08:48:33


Hi,

SharePoint uses different pages for mobile views.

About how to customize mobile view page for SharePoint, please check the links below (similar for SharePoint 2013):

https://msdn.microsoft.com/en-us/library/bb861936.aspx?f=255&MSPPError=-2147217396

https://msdn.microsoft.com/en-us/library/ms457259.aspx

Best Regards,

Victoria

aamirghanchi on Mon, 22 Aug 2016 13:28:47


Hi Murugesa. It seems like there is no solution for this using the browser page Edit option. I can customize the form in SP designer, but then will have to maintain the page everytime I add/update/remove the list columns, which will be very frequently due to the nature of the list. I will see if it is feasible. Otherwise if you have a solution that works with the browser page edit option then I will appreciate it.

Thanks.


aamirghanchi on Mon, 22 Aug 2016 13:30:24


Victoria, as I have mentioned earlier I am not working with Visual Studio. I will prefer a browser page edit solution.

Thank you.

Murugesa Pandian on Mon, 22 Aug 2016 14:23:29


Hi aamirghanchi,

Its by design and no option or solution to edit the list's form page through browser. Alternatively you may try to identify the user agent through Master Page and redirect to appropriate page where you can put the SharePoint add-ins (with HTML5,jQuery Mobile UI or MVC.NET based implementation for Mobile View).

I hope you are working on TeamSite not publishing site template.



Murugesa Pandian | MCPD | MCTS | SharePoint 2010 |



aamirghanchi on Mon, 22 Aug 2016 15:14:28


Thanks. I don't intend to edit the form itself. I just need to edit the wikipage NewForm.aspx by inserting my jquery/javascript code (Client Side Rendering) by using either the ScriptEditor webpart or the JSLink. this works fine when viewing page in the regular desktop view, but not in the mobile view. Sharepoint seems to omit the javascript code I added on the mobile view.

Murugesa Pandian on Mon, 22 Aug 2016 18:14:49


Thanks. I don't intend to edit the form itself. I just need to edit the wikipage NewForm.aspx by inserting my jquery/javascript code (Client Side Rendering) by using either the ScriptEditor webpart or the JSLink. this works fine when viewing page in the regular desktop view, but not in the mobile view. Sharepoint seems to omit the javascript code I added on the mobile view.

No that is also not possible, SharePoint will strip the scripts on the page while its rendering it on mobile browser.

And also its not possible for you to follow the Victoria's suggestion, only option left now for you is, implement the SharePoint-Add Ins with HTML 5 or MVC.NET based forms.