我正在使用 Icenium Graphite 开发应用程序。
在某一时刻,我正在显示使用具有编辑按钮的 Kendo Grid 的人员列表。使用此编辑按钮,用户可以编辑该特定记录。当用户单击编辑按钮时,该记录以另一种形式打开。用户保存编辑的记录并返回显示网格的同一页面。为了导航回网格页面,我正在使用 window.location.href = "index.html#tabstrip-login";
但在这种情况下它不起作用。
请让我知道出了什么问题。
我正在使用 Icenium Graphite 开发应用程序。
在某一时刻,我正在显示使用具有编辑按钮的 Kendo Grid 的人员列表。使用此编辑按钮,用户可以编辑该特定记录。当用户单击编辑按钮时,该记录以另一种形式打开。用户保存编辑的记录并返回显示网格的同一页面。为了导航回网格页面,我正在使用 window.location.href = "index.html#tabstrip-login";
但在这种情况下它不起作用。
请让我知道出了什么问题。
我想你想要这个:
var url = "";
if (typeof window.location.href != "undefined") {
url =window.location
}else{
url = document.location// or try this document.URL
}
根据您的问题,我假设您在应用程序中使用 Kendo UI Mobile。如果是这样,您将需要使用Application 对象的navigate()
方法来切换视图。
例如,假设您有一个带有以下标记的应用程序:
<div id="one" data-role="view">
One
</div>
<div id="two" data-role="view">
Two
</div>
您可以Application
使用以下方法创建您的:
var application = new kendo.mobile.Application( document.body, { initial: "#one" } );
然后通过调用来切换视图navigate()
。这会将应用程序切换到第二个视图:
application.navigate( "#two" );