w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Backbone View event firing only once after view is rendered
Since you're not calling render() again, delegateEvents won't be called again. You can just call delegateEvents directly in your router. This is just an example; there are probably more elegant ways to do it. delegateEvents basically rebinds the events to your view. This is useful if the html of your views gets removed from the dom. That looks like what is happening in your example. search: function () { if (!this.searchView) { this.searchView = new SearchView(); } $('#content').html(this.searchView.el); this.searchView.delegateEvents(); this.headerView.selectMenuItem('search-menu'); }

Categories : Javascript

why backbone view is not getting rendered
Oye, you've got a few problems. To answer your specific question, your render method of your view should take your view's model instance and get something from this.model.toJSON() it to get at its data to pass to the template method (toJSON really returns "JSONable" objects). But that's not all. Besides a few html issues, you also have stylistic problems. Collections generally should not be concerned with views, only data (*). Views should be concerned with with collections and models. Collections communicate to views via event binding, which I see you are doing. However, for reuse purposes, you may have more than one combination views that might want to listen to events in the collection. By setting up the event binding in the collection, you've effectively limited your collectio

Categories : Backbone Js

the View cannot be rendered from Controller
You need to do do something with the returned data. When you submit an AJAX request, you need to implement a callback method that will take the returned data and update your UI with it or whatever. That's all on you, the page doesn't just automatically re-render for you. $.post("@Url.Action("Kq_Read", "MyController")" + "?date=" + value, function (result) { // do something with `result` });

Categories : Asp Net Mvc

How to retain the 0 value after the view page is rendered?
You need to define this in your timepicker configuration like $('#timepicker').timepicker({ showPeriod: true, showLeadingZero: true }); You can find more information on Francois Gelinas page on TimePicker

Categories : Jquery

How do I use basePath() in a view rendered out of a library?
The base path of the helper must explicitly be set. Grab the plugin from the renderer and set the base path first before rendering: // create your view model $renderer->plugin('basePath')->setBasePath('/foo'); // render view model now

Categories : PHP

How to check what rendered partial view?
you can easily use this over load of the Html.Partial method PartialExtensions.Partial Method (HtmlHelper, String, Object) http://msdn.microsoft.com/en-us/library/ee402926(v=vs.108).aspx allowing you to pass a model to the partial view which in your case can be an int denoting an index so you partial views changes to <input id="txtSomethingElse_@Model.ToString()" class="input"/> where Model is of type int and your code where you are to render this view will change to <div id=element1> @Htm.Partial("CommonView", 1) @*Other data...*@ </div> <div id=element2> @Htm.Partial("CommonView", 2) @*Some other data...*@ </div> <div id=element3> @Htm.Partial("CommonView", 3) @*More other data...*@ </div>

Categories : C#

Possible to add partial view into a pre-rendered partial view in MVC3/4 within browser request?
You can add partial views with ajax: Controller "MyController": public ActionResult GetPartial() { var identifier = Guid.NewGuid(); return PartialView("_MyPartial", identifier); } JS: function addPartial(){ $('<div></div>') .load('@Url.Action("GetPartial", "MyController")') .appendTo('#container'); } First partial view: <div id="container"></div> <input type="button" value="add" id="btnAdd" /> JS: $('#btnAdd').click(addPartial);

Categories : Dotnet

Defining the location a section is rendered in a view
You cannot instruct where sections will be rendered in your "Page level", unless you introduce another level of sub-templating / partial view. I'm assuming you don't want always to display two columns content above one column content. If you want to be able to occasionally render two columns above the one column section, then add another section into your template (layout view) something like: @if (IsSectionDefined("oneColumnAfterTwo")) { @RenderSection("oneColumnAfterTwo", false) <div class="row"> @RenderSection("oneColumn_1", true) </div> } And modify your page/views to include oneColumnAfterTwo instead of oneColumn where needed.

Categories : Dotnet

Django figure out which template rendered the view you are seeing
Personnaly I use this : https://github.com/django-debug-toolbar/django-debug-toolbar The Django Debug Toolbar is a configurable set of panels that display various debug information about the current request/response and when clicked, display more details about the panel's content. Currently, the following panels have been written and are working: Django version Request timer A list of settings in settings.py Common HTTP headers GET/POST/cookie/session variable display Templates and context used, and their template paths SQL queries including time to execute and links to EXPLAIN each query List of signals, their args and receivers Logging output via Python's built-in logging, or via the logbook module There is also one Django management command currently: debugsqlshell:

Categories : Python

backbone.js: Fire event when view is rendered
If you want to do something(fire an event or anything else) for all cases when the render method is called, the most straight forward way might be to update the render method in your copy of Backbone's source code (assuming you want the behavior across the project). By default the render method just returns 'this' render: function() { return this; }, If there is something you always want to do before render, you can add it within the render method render: function() { //add your extra code/call return this; }, Alternatively you can also override the prototype of Backbone.View function and update/create your own version(s) something like _.extend(Backbone.View.prototype, Backbone.Events, { render: function() { console.log('This is a test'); return this; } }); var testV

Categories : Javascript

Navigation Controller is rendered over the view I navigated to
Well, I figured it out. In your sub-view (BRSMyListSubViewController in my case), in viewDidLoad, you need to set one of these two self.edgesForExtendedLayout = UIRectEdgeNone; self.automaticallyAdjustsScrollViewInsets = NO; OR self.edgesForExtendedLayout = UIRectEdgeNone; self.extendedLayoutIncludesOpaqueBars = YES; Interestingly enough in root view controller these value are set to default UIRectEdgeAll, NO and YES respectively but its tableView is NOT under navbar and footer. I don't know why it's so illogical. It's also strange that edgesForExtendedLayout has to be mixed with one of two other properties even though it's clearly responsible for the behavior. PS. For those who wants to run it on iOS 6. Surruound the code with if ([[[UIDevice currentDevice] systemVersion] floatV

Categories : IOS

page is not rendered in ie8. Renders only in compatibility view mode
<!DOCTYPE HTML should be on the first line of the document in order to swtich to standard (i.e. non-compatibiliy) mode. If you really need compatibiliy mode, you may just add blank line at the beginning of the file, or some comment like <!-- Yes, I like quirksmode --> to make your action explicit.

Categories : CSS

ASP.NET MVC4 PartialView Not Being Rendered Inside Parent View
Without seeing more of your solution, it's a bit fuzzy, but I believe you want to still return the Index and pass the model data into the Partial in your view. The way you are doing it would return only the partial view, which is why you're getting those results. So in the filtered index: return View(viewModel) And in the index view, pass the data to the partial, which I assume without seeing has the right model association to display. UPDATE If you're looking to dynamically pull a subset of data and leave the rest untouched, then do an AJAX POST with the filter information to the action specified for the partial view. Take the data results and place them in the Linecard div. There are many ways to send the data (bundle by JSON, serialize form, individual data points). Here are s

Categories : Ajax

xcode (osx) : clic on button in view of custom view controller failed
You create a view controller which has a view associated with it. You create a new NSView. You overwrite your newly created NSView with the view controller's view. Finally, you add a reference to the view controller's view to the window's content view. //this does the same as your above code ViewController *viewController = [[ViewController alloc] initWithNibName:@"ViewController" bundle:nil]; //in ios, you typically don't add things straight to the window [[_window contentView] addSubview:viewController.view]; This is saything that buttonAct: isn't class method for NSContentSizeLayoutConstraint. [NSContentSizeLayoutConstraint buttonAct:]: unrecognized selector sent to instance 0x1061178a0

Categories : Misc

Ember - How to run a method/function once a view is rendered and its data is loaded?
The thing here is that didInsertElement only notifies you when the template has being rendered into the DOM, images loaded or not. Normally the rendering will wait until your model has being resolved to render the template, but in case of images this is somewhat different, because I guess your model only contains the url's to the images and not the raw data. Should I be using "on"? If so, on what? Where? To be notified when all your images has being loaded you could use a plugin like: http://desandro.github.io/imagesloaded/ and attach an observer to the plugin event to be notified, ember does not know when your images are being completely loaded it cares only for your model being resolved, then it will render your template. Hope this helps.

Categories : Ember Js

Could not find "application" template or view. Nothing will be rendered Emberjs RailsAPI
I guess your problem lies in the fact that the handlebars template files extension should be .hbs instead of .hb, try to rename your templates to: index.hbs application.hbs foo.hbs ... Hope it helps.

Categories : Javascript

Why would HTML show up in view:source but not be displayed or rendered on the page?
Any changes from the raw html you see in view source to the rendered DOM in the browser is caused by JavaScript. There must be some code on that page that is removing your table. Can you please provide some code examples of scripts that are on the page and that you are including?

Categories : HTML

Testing controller action for expected rendered view in Playframework 2.1
Not sure to fully understand, but I think you can test your controller, and the rendered view by asserting that the rendered view contains some expected data. From the Playframework documentation: @Test public void callIndex() { Result result = callAction( controllers.routes.ref.Application.index("Kiki") ); assertThat(status(result)).isEqualTo(OK); assertThat(contentType(result)).isEqualTo("text/html"); assertThat(charset(result)).isEqualTo("utf-8"); assertThat(contentAsString(result)).contains("Hello Kitty"); }

Categories : Java

how to add animation to a second view which is inside first view in xcode for ipad using storyboard
If your self.secondview is hidden then you need to make it unhidden and set the alpha to 0. If the secondview is hidden that doesn't mean it's alpha is 0. So use the same code but instead of make it hidden set the secondview.alpha = 0; or in your case make it from the storyboard.

Categories : IOS

in Meteor.template.rendered how to make a call after everything is rendered (after the {{#each}} loop finishes)
I've found Meteor to be a little funny with how often it renders templates, and jQuery functions can end up building up. I've taken to adding console.log("users rendered"); to understand how many times and when the render callback is triggered. One thing I've had some success with is wrapping that template inside another, and then tying the callback to the outside template. Something like this: <template name="container"> {{> users}} </template> <template name="users"> {{#each user}} <li id="{{_id}}"> <input type="checkbox" checked /> <span><select name="colorpicker"> {{#each color}} <option value="{{mColorCode}}" {{selected ../mColor mColorCode}}>{{mColorName}}</option&

Categories : Meteor

zend framework 2, return the rendered contents of a view inside a JSON Model
you are returning the view model from an event I thinks this doesn't have any effect in current viewmanager view model, fetch the current viewmodel from viewmanager and call setTerminal(true). or replace the created jsonmodel using the viewmanager

Categories : Json

brightcove not showing when rendered (not page refresh - plain Backbone.js View re-render)
You should avoid using <script> tags inside your template. The external script should definitely be outside of your template and you can replace the following: <script> window.BCVideo = BCVideoFunction(); //BCVideoFunction as module pattern. </script> With: <% window.BCVideo = BCVideoFunction(); %>

Categories : Javascript

Route transitions destroy rendered view object; "Error: Object in path [blah] could not be found or was destroyed."
I took a look at the ember source, the error comes from a low-level package of ember, ember-metal - property_set.js. The code suggests that setPath is expecting a path and is getting a key without a path. It splits on the . and slices to get the parent path, which is where it's loosing the last character. Try looking at the stack trace from that error, and double back to where the exception originates. Posting a jsbin demo which has the stack trace would help with debugging.

Categories : Ember Js

xcode title bar / collection view
Well, one way to achieve what you're looking for would be to embed the view controller or collection view controller that contains your collection within a navigation controller (Editor->Embed In>Navigation Controller). Then instead of linking your controller with your collection directly to your tab bar, you would link the navigation controller that contains it.

Categories : Xcode

In what way a view or a window could know that mouseDown outside itself in Xcode?
AppKit takes care of forwarding mouse events to the window/view where those events took place. If you wish to catch mouse events in other locations, you can use a local event monitor. In the class that’s supposed to implement this behaviour, which is probably the class that owns the panel, define an instance variable or declared property to hold an event monitor instance: @property (nonatomic, strong) id mouseEventMonitor; When you show your panel, add a mouse event monitor: self.mouseEventMonitor = [NSEvent addLocalMonitorForEventsMatchingMask:(NSLeftMouseDownMask | NSRightMouseDownMask | NSOtherMouseDownMask) handler:^NSEvent *(NSEvent *event) { if (event.window != self.panelWindow) [self dismissPanel]; return event; }]; When you dismiss the panel, remove the mo

Categories : Objective C

xCode Detail View is Empty
Your problem is using alloc init to create an instance of TaskDetailViewController. You've created that controller in the storyboard so you should instantiate it from the storyboard using an identifier that you give it (DetailViewController in my example): TaskDetailViewController *newTaskDetailViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"DetailViewController"];

Categories : IOS

Where can I view Xcode generated code?
xCode is different from Visual studio. Visual Studio provides lots of simplicity for development. xCode has it's own way of doing things. Once you create a View typically you can see the code in associated ViewController class (.m) and header(.h) Probably you need to have a look at the basics, these guide can help you in detail http://www.hongkiat.com/blog/ios-development-guide-part1/ http://developer.apple.com/library/ios/navigation/

Categories : Xcode

Xcode - How to switch view in storyboard
You can't just use a UIImage. You need to use a UIButton and then under the properties set the button to custom and set background image to the image you want. Then you can click and drag from the button to the new view and choose modal. I'm having you choose modal because from what I can gather, you aren't using a navigation controller. Therefore you'd modally want to present the view controller.

Categories : IOS

How to link to another view of storyboard Xcode
There are a couple of ways to do this. The first is to create a segue that directly links the login button to the new view controller. If you want to do this, right click drag (or control drag) from the button to the new view controller. This should make a grey line going from the first controller to the second one. You can then click on the little circle in the middle of the segue in interface builder to give it a name and specify the type. Alternatively, if you created the login button with code, or would just like more control over your segues, you can create a generic segue in interface builder, meaning just control drag from one view controller to the other. If you do it this way, YOU MUST NAME THE SEGUE so you have a way to invoke it later. Then you just call [self performSegueWith

Categories : IOS

How do I simply switch view controllers using XIB's in Xcode?
- (IBAction) admissionsButtonPressed:(id)sender { AdmissionsViewController *detailViewController = [[AdmissionsViewController alloc] initWithNibName:@"Admissions" bundle:nil]; [self.navigationController pushViewController:detailViewController animated:YES]; //[detailViewController release]; // Do that if you don't ARC. } Given that Admissions.xib is the name of your xib file and AdmissionsViewController the name of your view controller class. Make sure to link the action admissionsButtonPressed: to the related touch up inside event within that view in xib, where the button resides. What's the issue with that? There are hundrets of tutorials and samples around explaining exactly that. That was

Categories : IOS

View titanium code in xcode format
This is the beauty of titanium that it uses the native code and you could run its project in xcode too.Double click on the ProjectName.xcodeproj and it would open your project in xcode and then you can run code from there Thanks

Categories : Xcode

Xcode, Custom view - zero frame/bounds
The views are probably not laid out yet when you try to get the positions. The viewDidLoad in NSViewController? question points out that loadView should be used to modify the view's layout. This answer in the same question shows a trick to make your Cocoa code similar to the Cocoa-touch one.

Categories : Xcode

Convert a Single View to Tabbed App in iOS/Xcode
Without understanding more about your current setup your question can't really be answered with any kind of accuracy. Having said that it's easy enough to add a UITabBarController to an existing app, really all you need to do is change the initial view controller. I presume you haven't tried searching for an example... Implementing UITabBarController in code: http://simplecode.me/2011/12/05/tab-based-ios-apps-uitabbarcontroller/ Storyboards: http://mobile.tutsplus.com/tutorials/iphone/ios-quick-tip-creating-a-uitabbar-application-with-storyboards/

Categories : IOS

Xcode - content offset in scroller view
Well I've found the solution after a day of thinking, so if anyone has the same problem, heres's the solution: Solution from here: http://www.pressingquestion.com/1128098/Disable-Uiscrollview-Scrolling-When-Uitextfield-Becomes-First-Responder Basically, iOS has an in-built scroller, which is also scrolling for you if the text field is off the screen (usually the center of the text field is off the screen, off the screen being out of view, if it's hidden by the keyboard, it's still considered to be on the screen). So I called my function, did the scrolling, then iOS did his scrolling and messed me up. So you need to disable iOS' in-built scrolling.

Categories : Misc

How can I get my Table View in xcode 4.6 ios6 working?
It looks like you've wired up your tableview datasource incorrectly. [UITableView tableView:numberOfRowsInSection:]: unrecognized selector sent to instance 0xb3b0800' This is saying that the framework attempted to call the tableView:numberOfRowsInSection selector on an object that does not conform to the UITableViewDataSource protocol.

Categories : IOS

How can I split a same file view in Xcode editor?
View the .m file or the .h file in the normal editor. Open the assistant editor. The counterpart will appear in the other pane. If you use a trackpad, do a three-finger up or down swipe to switch counterparts. If you do this in the pane with the .h it will switch to the .m or visa-versa. Or use the Ctrl-Cmd-Up arrow (or down arrow) to switch counterparts. You will now have the same .h or .m in both panes.

Categories : Xcode

xCode: How to sort a collection view with long press?
You can use the method moveItemAtIndexPath:toIndexPath: for doing this. Here is the doc link. You just need to add a gesture recognizer to each cell and and call the method after you do the drop of the view. You might want to write code to get the index path of source cell and destination cell though before calling the above method. Also look towards the end of this doc page.

Categories : IOS

xcode ios how to set the Table View Cell on a fixed position
As per my understand your making an universal app and want to add a tableview in your application. First of all you mentioned that your using Storyboard, So defiantly your using two different storyboards one is for iPhone and another is for iPad. For making position consistence follow below steps Take an outlet for UITableView Make a condition in code with basic idioms if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { // iPad-specific code } else { // iPhone-specific code } adjust table view position like this if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { // iPad-specific code yourTableview.frame = CGRectMake(10,20,300,400); } else { // iPhone-specific code yourTableview.frame = CGRectMake(10,20,150,200); }

Categories : IOS

Display sqlite3 results in Table View using xcode
I don't know if there are more problems, but numberOfSectionsInTableView: should return 1, not 0 (otherwise the table view will always be empty). Alternatively, don't implement that method, as the default value is 1.

Categories : Xcode

How to show json data in table view in xcode
You need to add Thee label in your UITableViewCell. And fetch each Value as you needed. It is simple fetch as you fetch value of name and put it to relevant UILabel. You also need to expand size of your cell of UITableView by following method. -(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath*)indexPath { return 80;// write as you need. }

Categories : IOS



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.