Just getting to grips with this cool framework and interested in adding in an extra feature into the default toolbar. I assume the toolbar is from the following:
#Edit.Toolbar(Content)
And the functions from which each item is defined is in the 'inpage.js' file which houses all the menu item actions (add, new, replace). But when I try the following (inside in 'image max 3.cshtml'):
#Edit.Toolbar(Content, actions: "edit,replace,color");
and have a new colour action created in 'inpage.js':
'color': {
title: "Toolbar.Sort",
iclass: "icon-sxc-table",
showOn: "edit",
addCondition: function (settings, modConfig) { return modConfig.isList && settings.useModuleList && settings.sortOrder !== -1; }
},
This however is not presenting anything to the screen for me. I assume I am missing something but my aim was to replicate the reorder feature action but instead have a modal popup colour palette in order to change the colour of the background of each indivudal 'Image(s) max 3. in a row' content type views.
Appreciate any and all help!
Thx
2sxc 08.06 is out, and allows this now. Check out the 2sxc-wiki https://github.com/2sic/2sxc/wiki/Html-Js-Command-Custom-Code
Related
I want to show dropdownlist always to down. (Is it posible?)
If bottom space is less then the height of dropdown list it's show list to up.
I want to show list always to down.
Thanks in advance
This can be achieved by adding the following attribute to your CSS class of your dropdown list:
.drop-down {
top:100%;
}
The same can be used to force the list to go upwards: bottom: 100%;
Here is a jsfiddle demo.
EDIT:
The standard HTML form Select Option (<select><option> <option></select>) can not be manipulated to expand into a certain direction. You'll have to write your own custom dropdown menu with JavaScript to implement this functionality.
After a quick browse I've noticed that others have struggled with the problem you're having. And apparently the following CSS code seems to fix it in some cases.
select { vertical-align: top; }
What you can do is set the attr size using jQuery like so
jsFiddle : https://jsfiddle.net/ou5n9u3y/
jQuery
$(function () {
var dropdownOptions = $('.dropdown-selector').find('option').length;
$('.dropdown-selector').attr('size', dropdownOptions);
});
I have a simple WebView application. In one of the cases, I show a file, to allow user go back a UINavigationBar is shown:
navigationBar = [[UINavigationBar alloc] initWithFrame:CGRectMake(0, 20, 320, 44)];
navigationItem = [[UINavigationItem alloc] init];
navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:#"Back"
style:UIBarButtonItemStyleBordered
target:self
action:#selector(buttonClicked:)];;
[navigationBar pushNavigationItem:navigationItem animated:YES];
[self.view addSubview:navigationBar];
This is working nice. It shows a back button, and when back button is clicked it executes selector (button style must be improved, but I'm newbie with xCode and c# and this will come later).
In the selector i load previous url, but I can't figure out how to hide button and bar.
- (IBAction) buttonClicked:(id)sender {
return [self.webView loadRequest:[[NSURLRequest alloc] initWithURL:[NSURL URLWithString: lastURL]]];
}
I've tried several things, like removeFromSuperView:
[navigationBar removeFromSuperview];
Hide it:
[self.navigationController setNavigationBarHidden:YES animated:YES];
self.navigationController.navigationBar.hidden = YES;
// or
[navigationItem hidesBackButton];
// or
navigationBar.hidden = TRUE;
Using the selector (id):
[sender show:NO];
Using the alpha property:
navigationBar.alpha = 0,0;
Free memory space:
navigationItem.dealloc;
But nothing works... I think I'm missing some important detail, because I don't know really how xCode works...
Any help will be appreciated!
Personally, I would never add a navigation bar like that, but rather have a root navigation controller, which has a root view controller that holds a webview as it's view.
You did not make it very clear, how do you actually show the file?
Anyway, this code:
[self.navigationController setNavigationBarHidden:YES animated:YES];
is not working for you because you haven't provided your view controller with a navigation controller.
Provide one, maybe best in the main storyboard, and setup your view controller (that holds the webview) as its root view controller. To do that, open the storyboard, and drag/drop a UINavigationController to the main area. You have to tick the option "Is Initial View Controller". Note: when you did the drag/drop, a default root view controller was already provided. You can either leave that one, or provide your own, if you already had one in the storyboard. To do that, delete the linked one, and ctrl-click and drag from the Navigation Controller to the View Controller, to setup it as its Root View Controller. I've attached an image to showcase what I've described.
Hi coder i am new to jquery. i serach alot but fail to find this what i am looking is not a customize application, i just want process or method how we can achieve this.
Suppose i have a menu or link like below
Home
About
Contact
As a link or menu and when i click on that any of the link or menu i srcoll down to position of the page where details for it present..
Just like This link where click on the above menu scroll to the
position of it on the page
This should be a single page application.
Any idea's or tutorial for this i want to do it jquery.
I can use scrollup(), scroll(), animate() but how to proceed this that is the main concren any help would be appreciated.
Are you by any chance talking about HTML anchors?
http://www.echoecho.com/htmllinks08.htm
This is the best link for your solution
Single Page Site with Smooth Scrolling, Highlighted Link, and Fixed Navigation
In this link you get how to stick your menu using this
$(window).scroll(function () {
var window_top = $(window).scrollTop()+12; // the "12" should equal the margin-top value for nav.stick
var div_top = $('#nav-anchor').offset().top;
if (window_top > div_top) {
$('nav').addClass('stick');
} else {
$('nav').removeClass('stick');
}
});
use scrollto.js file to scroll through the page and call it in that function for smooth scrolling
$("nav a").click(function (evn) {
evn.preventDefault();
$('html,body').scrollTo(this.hash, this.hash);
});
I hope this will help you
$('html,body').animate({scrollTop: $('#scrollToId').offset().top});
Check this solution jQuery scroll to element
please forgive the newness level I'll be exhibiting.
I created a new iPad Master/Detail (UISplitViewController) app in Monotouch.
The master controller on the left is a UITableViewController. The detail on the right is just a UIViewConroller. These are loaded by default in the AppDelegate code.
In the master controller I then added some items to the table and overrode the RowSelected() event and that works great, so I can get the item selected. I've added an additional UIViewController (DetailViewController2) that I want to display on the right side of the screen when an item is selected in the table. It really doesn't matter which item, I just want to change the contents of the right side where the DetailViewController is to the DetailViewController2. I've tried a lot of things and nothing working -- I know this should be obvious, but I'm lost.
Thanks for any help.
If you are using UISplitViewController, the way to change the master and detail controller is to update the ViewControllers property. It always wants both, the master and the detail controller.
If you want to update the detail only, your code would be something like this:
var masterController = splitController.ViewControllers[0];
var newDetailController = new DetailViewController2();
splitController.ViewControllers = new UIViewController[] { masterController, newDetailController };
For Documentation see here:
http://developer.apple.com/library/ios/#documentation/uikit/reference/UISplitViewController_class/Reference/Reference.html
MonoTouch is 5.2.12. iOS is v5.1.1 (Simulator)
Seems like I'm missing an important piece of a puzzle here.
I'm subclassing DialogViewController and set it as the only controller in my UINavigationController.
In ViewWillAppear of the subclassed DialogViewController, I'm trying to set the left and right bar button items:
this.NavigationController.NavigationItem.LeftBarButtonItem = new UIBarButtonItem(UIBarButtonSystemItem.Done, this.HandleDoneButtonTouched );
Neither one of them is showing up. The title however is displayed. If I debug, I can see that the items are properly set.
I have also tried to use SetItems() on the navigation controller: no effects either.
The navigation controller is presented modally in a page sheet.
Navigation items are not usually updated through the navigation controller. Instead, they are updated via the NavigationItem property on the view controller:
this.NavigationItem.SetRightBarButtonItem(
new UIBarButtonItem(UIImage.FromFile("some_image.png")
, UIBarButtonItemStyle.Plain
, (sender,args) => {
// button was clicked
})
, true);
http://docs.xamarin.com/ios/recipes/Content_Controls/Navigation_Controller/Add_a_Nav_Bar_Right_Button