删除优化-共享点 [英] Remove Refinement - Sharepoint

查看:73
本文介绍了删除优化-共享点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

您知道如何仅在部门中取消优化吗?

请帮助我.

谢谢..

推荐答案

你好

我记得这是您的自定义Web部件.

I remember that it's your customize webpart.

我想您将下拉值保存在列表中.

I guess you save the dropdown value in a List.

如果那样,您可以通过sharepoint javascript删除优化.

If that, you can remove refinement by sharepoint javascript.

建议添加列名删除类型,并且类型可以是bool.

Recommend that add the column name deleted type, and type can be bool.

您按已删除的类型列加载下拉列表值过滤器.

You load dropdown list value filter by deleted type column.

删除细化"会将项目删除的类型"列更改为true.

Remove refinement will change the item deleted type column to true.

你了解我吗?

您可以通过REST更新列值.

And you can update column value by REST.

    var executor = new SP.RequestExecutor(siteUrl); 
    var bb = "{'__metadata':{'type':'SP.Data.DemoListListItem'},'deletetype':'true'}";
    executor.executeAsync({
        url: siteUrl + "/_api/web/lists/GetByTitle('DropDownList')/items(1)",
        method: "POST", 
        body: bb,
        headers: {
            "X-RequestDigest":


(" #__ REQUESTDIGEST).val(), "IF-MATCH":"*", "X-HTTP-Method":"MERGE", "accept":"application/json; odata = verbose", "content-type":"application/json; odata = verbose", "content-length":bb.length } }); console.log("Updated");
("#__REQUESTDIGEST").val(), "IF-MATCH": "*", "X-HTTP-Method": "MERGE", "accept": "application/json;odata=verbose", "content-type": "application/json;odata=verbose", "content-length": bb.length } }); console.log("Updated");

当然,您可以通过javascript api更新值.

Of course, you can update the value by javascript api.

function updateListItem(siteUrl) {
    var clientContext = new SP.ClientContext(siteUrl);
    var oList = clientContext.get_web().get_lists().getByTitle('DropDownList');

    this.oListItem = oList.getItemById(3);
    oListItem.set_item('deletetype', 'true');
    oListItem.update();

    clientContext.executeQueryAsync(
        Function.createDelegate(this, this.onQuerySucceeded), 
        Function.createDelegate(this, this.onQueryFailed)
    );
}

function onQuerySucceeded() {
    alert('Item updated!');
}

function onQueryFailed(sender, args) {
    alert('Request failed. ' + args.get_message() + 
        '\n' + args.get_stackTrace());
}



这篇关于删除优化-共享点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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