Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/386.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/sorting/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在SharePoint内容编辑器中对javascript创建的列表进行排序/筛选_Javascript_Sorting_Sharepoint_Filter_Html Table - Fatal编程技术网

在SharePoint内容编辑器中对javascript创建的列表进行排序/筛选

在SharePoint内容编辑器中对javascript创建的列表进行排序/筛选,javascript,sorting,sharepoint,filter,html-table,Javascript,Sorting,Sharepoint,Filter,Html Table,我在SharePoint 2010中工作,我有一个列表,我想以非常具体的方式显示它。基本上,我使用Javascript、jquery和SPServices来查询列表,并在内容编辑器web部件中构建一个表,其中的链接根据登录名和请求状态而有所不同。好的,这样就行了,但现在我正在尝试对Javascript生成的表进行排序/过滤,这对我来说不是什么新鲜事 我尝试了几种不同的Java脚本来进行排序和筛选,而这一个似乎正是我所需要的:如果我在content editor web部件中创建一个HTML表,它

我在SharePoint 2010中工作,我有一个列表,我想以非常具体的方式显示它。基本上,我使用Javascript、jquery和SPServices来查询列表,并在内容编辑器web部件中构建一个表,其中的链接根据登录名和请求状态而有所不同。好的,这样就行了,但现在我正在尝试对Javascript生成的表进行排序/过滤,这对我来说不是什么新鲜事

我尝试了几种不同的Java脚本来进行排序和筛选,而这一个似乎正是我所需要的:如果我在content editor web部件中创建一个HTML表,它会起作用,但是如果该表在页面加载中不存在,那么问题就开始出现了

非常感谢您的帮助或建议

以下是一些代码片段:

<table class="table-autosort table-autofilter" id="openReqTable" bordercolor="#000000" border="1" cellspacing="0" cellpadding="5">
<thead>
    <tr>
        <th class="table-sortable:numeric table-filterable">Request ID</th>
        <th>
...
        </th>
        <th>Request Status</th>
    </tr>
</thead>
<tbody></tbody></table>
<script src="/Utilities/jquery-1.4.2.min.js" type="text/javascript"></script>
<script src="/Utilities/jquery.SPServices-0.5.7.min.js" type="text/javascript"></script>
<script type="text/javascript">
    var tableRowCount = 1;
    var query;
...

    $(document).ready(function()
    {
        currentUserVar = $().SPServices.SPGetCurrentUser({
            fieldName: "UserName",
            debug: false
        });

...

    var groupCollectionVar = $().SPServices({
                                operation: "GetGroupCollectionFromUser",
                                userLoginName: currentUserVar,
                                completefunc: groupTestFunc
                                });
});

function groupTestFunc(xData,status)
{
...
        newRow=document.getElementById('openReqTable').insertRow(tableRowCount);
        newTableColumnA=newRow.insertCell(0);
...
        newTableColumnK=newRow.insertCell(10);
...
        newTableColumnA.innerHTML=requestIDLink;
...
        newTableColumnK.innerHTML=requestStatus;
        tableRowCount++;
    });
}</script><script src="/Utilities/table.js" type="text/javascript"></script>