Is it possible to have a Mvc4 Link (http://localhost:59446/TierManagement/CreateTier) in the contextmenu of jsTree, which will take me to new view (CreateTier page)
On click of that item in context menu, just redirect to the required page using
document.location.href="<!--your link goes here-->";
the code would be
action(obj){
document.location.href="<!--your link goes here-->";
}
Related
I am using display tag to display a table of records that is opened inside a dialog, but when i click on pagination link , it redirect to anothe page and hide dialog
I need to keep pagination in the same dialog
Thank's in advance.
I would suggest you use a iframe in the dialog box and within the iframe you use the displaytag.
JSP with dialog:
<sj:dialog>
<iframe src="path/to/actionwithdisplaytable.action" with="" height="">
</iframe>
</sj:dialog>
JSP with displaytag:
<displaytag:...>
<displaytag:column/>
</displaytag:...>
Thank you for your response, the problem is fixed by adding the requestURI, containg the name of myAction.
I want to add an hyperlink or a button in my FitNesse page.
On click of this link or button a popup window with some HTML content should open.
Please let me know if this is possible in FitNesse? If yes, how to achieve this?
I tried to search on FitNesse website but could not get information.
Adding a link to a wiki page is easy: just type the link, or use [[word or phrase][url]]. But this will not open a pop-up. I don't know how to achieve that by just using the wiki.
In a Slim fixture's result you can return any HTML (sometimes you will have to surround it with <div></div>), so you can return ... and in the test result there will be a hyperlink that will open in a new tab...
I need help creating this below UI (click on "Ui mock up" link) as a popup when clicking on a link. And each text (Text1, Text 2 and Text 3) would be a hyper link
We are using Kendo UI with ASP.Net MVC framework.
UI mock up
Please lhelp
Try this:
View:
#(Html.Kendo().Window()
.Name("popup")
.Title("Whatever")
.Content(#<text>
anything you want here: the HTML for your 3 text links, for example
</text>)
.Modal(true)
.Visible(false)
.Width(200)
)
Script:
$("#popup").data("kendoWindow").center().open();
Call the script when clicking the link you want to trigger the popup.
I am currently building a website containing lots of links to different sections of my website (also known as navigation). Lets call those links and their corresponding pages link1, page1 , link2, page2, link3, page3 etc.
The general code for them is this:
Link1
Link2
Link3
I want the user to click each link to move to the corresponding webpage and it works as supposed to. The problem is that I want the links to do nothing when the user is on the same page as the link they clicked (meaning it will only reload the page). Let me make this clear by using an example:
Current use: User is on page1. User clicks on link1. The browser will reload page1.
Desired use: User is on page1. User clicks on link1. The browser will do nothing.
TL;DR Essentially I am searching for an if clause. I have read there is no if clause in HTML simply because it's a markup language but what is another way to implement this? Thanks for your help.
The best answer I have found without the need to use JQuery or JS after munching through SO is this, answer made by Matt Crinklaw-Vogt:
Add a /#!. This will prevent the scrolling to the top and will also prevent the page reloading.
Code:
Link1
Original answer:
How do I stop a web page from scrolling to the top when a link is clicked that triggers JavaScript?
I'm not sure I like it, but you could use an empty bookmark to do this...
Link1
If you aren't on page1, it will load page1, but once you are there, it won't do anything.
Link2
OR
<a onclick = "return false;">Link2</a>
That cancels out the load.
On page load, you could use JS as follows
Link1
JS:
document.getElementById("link1").setAttribute("href", "#");
You can use javascript to compare the current url to the anchor link, and if they're the same, prevent the default click event. Using jquery:
var url = window.location.pathname,
urlRegExp = new RegExp(url.replace(/\/$/,'') + "$");
$('a').each(function(){
if(urlRegExp.test(this.href.replace(/\/$/,''))) {
$(this).click(function(event) {
event.preventDefault();
});
}
});
I am doing a PhoneGap app with JQuery Mobile and I have two pages, one that has a dynamic list of pages and one that has a form to either edit or create a page. These are in a single html file.
Tapping on a list item passes ?action=edit and tapping the "Add" button I have, passes ?action=add querystrings.
Here is a jsfiddle to visualize the pages
NOTE: The example doesn't act quite the same as the live code.
I am running my app on an Android phone and if I do these actions, the correct querysting is observed in the alert box: -
Click the add button on list page
Click back on the form page
Click the an edit list item link on list page
However, if I do it the other why around (click edit first, then the add button) clicking the add button never shows the add querystring in the alert box
(the jsfiddle example always locks the first clicked link's querystring, which is even worse than the live code!)
The problem here is that you're using a multiple template to do this. If you were using this as separate pages, this would work as normal. As a multiple app, the best way to handle this would be to make a link trigger the setting of some global variable that keeps track of the current state of the app.
Make the edit links like this
Page 15
Then make the script something like this:
var editingId = 0
function editPage(id){
editingId = id;
$.mobile.changePage("#editingPage");
});
$("div#editingPage").live("pageshow", function(){
loadDataForPage(editingId);
});