我试图在我的简单页面上使用分类法控件。但是,它始终呈现在页面的底部。隐藏字段保持原样,但分类控制始终位于底部。
在呈现的页面上,我总是将Test和blubb放在一起,分类标准控制在它之后: 测试 blubb [控制]
有没有已知的错误,为什么会发生这种情况?
<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
<%@ Import Namespace="Microsoft.SharePoint.ApplicationPages" %>
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Assembly Name="Microsoft.Web.CommandUI, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="t.aspx.cs" Inherits="sptaxpicker2.Layouts.sptaxpicker2.t" DynamicMasterPageFile="~masterurl/default.master" %>
<asp:Content ID="PageHead" ContentPlaceHolderID="PlaceHolderAdditionalPageHead" runat="server">
<link rel="stylesheet" type="text/css" href="style/taxonomypickercontrol.css">
<script src="scripts/jquery-1.9.1.js" type="text/javascript"></script>
<script src="scripts/taxonomypickercontrol.js" type="text/javascript"></script>
<script>
//Wait for the page to load
$(document).ready(function () {
//Get the URI decoded SharePoint site url from the SPHostUrl parameter.
var spHostUrl = "http://sp2013";
var appWebUrl = "http://sp2013/sites/dev";
var spLanguage = "en-us";
//Build absolute path to the layouts root with the spHostUrl
var layoutsRoot = spHostUrl + '/_layouts/15/';
//load all appropriate scripts for the page to function
$.getScript(layoutsRoot + 'SP.Runtime.js',
function () {
$.getScript(layoutsRoot + 'SP.js',
function () {
//Load the SP.UI.Controls.js file to render the Add-In Chrome
//$.getScript(layoutsRoot + 'SP.UI.Controls.js', renderSPChrome);
//load scripts for cross-domain calls
//$.getScript(layoutsRoot + 'SP.RequestExecutor.js', function () {
// context = new SP.ClientContext(appWebUrl);
// var factory = new SP.ProxyWebRequestExecutorFactory(appWebUrl);
// context.set_webRequestExecutorFactory(factory);
//});
context = new SP.ClientContext(appWebUrl);
//load scripts for calling taxonomy APIs
$.getScript(layoutsRoot + 'init.js',
function () {
$.getScript(layoutsRoot + 'sp.taxonomy.js',
function () {
$('#txbox').taxpicker({
isMulti: false,
allowFillIn: false,
termSetId: 'bed6c3ef-4eac-4bfb-9809-94112e7ba0c2'
}, context);
});
});
});
});
});
</script>
</asp:Content>
<asp:Content ID="Main" ContentPlaceHolderID="PlaceHolderMain" runat="server">
test<br /> <input type="hidden" id="txbox" /><br />blubb
</asp:Content>
<asp:Content ID="PageTitle" ContentPlaceHolderID="PlaceHolderPageTitle" runat="server">
simple test
</asp:Content>
<asp:Content ID="PageTitleInTitleArea" ContentPlaceHolderID="PlaceHolderPageTitleInTitleArea" runat="server" >
simpletest
</asp:Content>
谢谢! 最好, 基督教
答案 0 :(得分:0)
找到解决方案:将控件放在像div这样的容器中非常重要,而不是直接作为表数据,因为后面的javascript使用父元素来移动项目。