Sharepoint框架扩展问题 [英] Sharepoint Framework Extension Issue

查看:77
本文介绍了Sharepoint框架扩展问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,


 


我正在处理其中一项要求并陷入困境。下面列出了所有细节,并附上了已经取得的成果。从事过SPFx扩展工作的人员需要帮助。


 


业务要求


具有正确权限的用户应该能够替换文档库中的
现有文档。


 


UI要求


    在文档库的命令栏上添加"Up Revision"按钮
  • 按钮应该有权限的用户可以看到
  • 该按钮应仅在特定库中可见
  • 点击按钮,对话框应打开文件选择器和评论文本框

 


方法:


SPFx扩展ListView命令集


 


实施


< ul type ="disc"style ="">
  • JS调用REST apis执行必要的操作
  • 用于UI组件的Office UI Fabric

  •  


    逻辑


    < span style ="color:#1F3864">当用户在选择文件并放置注释后单击对话框上的"确定"时,该按钮应调用javascript函数。此函数执行以下操作:



    • 检查文件是否存在或不
    • 如果是,请查看文件
    • 上传新版本的文件
    • 使用用户的评论签入文件

     


    挑战



    • 在部署和安装时,该按钮仅在列表中可见而不是库
    • 调用JS实现上传新版文档的代码

     



    解方案

    有关挑战1:你能证明你的代码如何注册按钮的名单?列表和doclib具有不同的基本模板ID,因此可能存在差异


    fr challenge 2:检查例如  如何在Sharepoint 2013中使用JSOM在文档库中上载文档或  使用Javascript将
    文件上传到文档库。


    Hi,

     

    I was working on one of the requirement and am stuck. Stating below are all the details and attached is a gif of what has been achieved. Help is needed from someone who has worked on SPFx Extension.

     

    Business Requirement:

    The user with correct permission should be able to replace existing document in a document library.

     

    UI Requirement:

    • Add a button "Up Revision" on the Command Bar in Document Library
    • the button should be visible to users who have permission
    • The button should be visible only in a specific library
    • On click of the button, a dialogue should open with a file picker and comment text box

     

    Approach:

    SPFx Extension ListView Command Set

     

    Implementation:

    • JS to call REST apis to perform required actions
    • Office UI Fabric for UI Components

     

    Logic:

    When the user clicks OK on the dialogue box after selecting a file and putting the comment, the button should call a javascript function. This function does the following:

    • Check whether the file exists or not
    • If yes, check out the file
    • Upload the new version of the file
    • Checkin the file with comments from the user

     

    Challenges:

    • On deploying and installing, the button is only visible in the list and not the library
    • Call JS that implements the code for uploading the new version of the document

     

    解决方案

    for challenge 1: can you show the code how you register button to the lists? Lists and doclib has different base template ids so there may be difference

    fr challenge 2: check e.g. How To Upload Document In Document Library Using JSOM In Sharepoint 2013 or Upload file to document library using Javascript.


    这篇关于Sharepoint框架扩展问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆