Tag: sitecore

Sitecore 8 SPEAK:在JS文件中调用方法时出错

当我点击按钮时从Sitecore SPEAK应用程序调用JS文件中的方法时,我收到以下错误消息: TypeError:this.product不是函数this.product() this.product()是函数名: define([“sitecore”], function (Sitecore) { var model = Sitecore.Definitions.Models.ControlModel.extend({ initialize: function (options) { this._super(); }, products: function () { var input = this.get(“input”); $.ajax({ url: “/api/sitecore/Product/Find”, type: “POST”, data: { input: input }, context: this, success: function (data) { this.set(“output”, data); } }); }, product: function () { var input2 = this.get(“input2”); […]

Sitecore 8体验编辑器和jquery

以下javascript在页面编辑器模式下不起作用: Page.ClientScript.RegisterStartupScript(this.GetType(),”script”,””); 我改成了: Page.ClientScript.RegisterStartupScript(this.GetType(),”script”,”scSitecore&&scSitecore.prototype.initializeModalDialogs()”); 但现在没有任何东西在页面编辑器模式下保存。 要在noConflict模式下包含jquery,我添加了以下代码行: Page.ClientScript.RegisterStartupScript(this.GetType(), “script”, “jQuery.noConflict();window.onload = function(){var mainDiv = $( \”main\” );}”); 要包含高图我已经添加了一个ID为“容器”的div和后面的代码行。 在普通视图中,高图显示但不在页面编辑器模式下显示。 Page.ClientScript.RegisterStartupScript(this.GetType(), “charts”, “”); 容器代码.js: $(function () { $(‘#containers’).highcharts({ title: { text: ‘Monthly Average Temperature’, x: -20 //center }, subtitle: { text: ‘Source: WorldClimate.com’, x: -20 }, xAxis: { categories: [‘Jan’, ‘Feb’, ‘Mar’, ‘Apr’, ‘May’, ‘Jun’, ‘Jul’, ‘Aug’, […]

jcarousel插件无法在sitecore预览模式下工作

当我们在浏览器上运行页面时,jcarousel插件正在工作,但如果我们在sitecore预览模式下运行相同的页面(在sitecore中:单击顶部菜单中的Presentation。单击function区中的预览),则此插件不起作用。 如果您有解决方案,请告诉我。

asp:HiddenField的jQuery更新无法在回发中持久化

我在sitecore(它是一个ascx控件)中有一个子布局,它包含一个隐藏字段和一个图像映射。 根据单击的图像映射区域,我想设置隐藏字段的值,然后启动回发到服务器。 我的标记如下: function SetRegion(regionName) { $(‘#’).val(regionName); __doPostBack(”, ”); } 我的代码隐藏如下: protected void lnkRedirectButton_Click(object sender, EventArgs e) { string region = hdnRegion.Value; //at this point, I expect hdnRegion.Value to be “x” “y” or “z” but it’s always coming back empty 🙁 //do stuff… } 我添加了虚拟LinkBut​​ton作为回发的钩子(创建一个代码隐藏方法来处理回发)。 我已经在一个独立的Web应用程序中尝试了这个代码,它看起来工作正常,所以我想知道是否有一些正在发生的事情会破坏隐藏字段在回发过程中的价值? 澄清; 回发事件正在服务器上触发并处理好,我在javascript中使用alert()来确认隐藏的字段值是否正确设置。 编辑:重新标记的问题包括jquery-ui标记。 这个问题似乎与以下事实有关:所有这一切都发生在一个div中,它在jQuery UI库中使用$()。dialog()方法显示…